Skip to content
Merged
Show file tree
Hide file tree
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 @@ -457,7 +457,15 @@ class RestSecurityOracle {

for(index in individual.seeMainExecutableActions().indices){
val a = individual.seeMainExecutableActions()[index]
val r = actionResults.find { it.sourceLocalId == a.getLocalId() } as RestCallResult
val r = actionResults.find { it.sourceLocalId == a.getLocalId() } as RestCallResult?
/*
FIXME either we check every "as RestCallResult" cast in this class, or
we need to refactor how we pass around "individual" and "actionResults".
TODO need refactoring
TODO need invariant checks (eg if RestCallResult is missing, what property
like "stopped" must be in the individual?)
*/
?: break

if((a.verb == HttpVerb.PUT || a.verb == HttpVerb.PATCH || a.verb == HttpVerb.DELETE)
&& faultyPaths.contains(a.path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,14 @@ class DateGene(
extraCheck: Boolean
): String {
return if (mode == GeneUtils.EscapeMode.EJSON) {
val millis = LocalDate.of(year.value, month.value, day.value).atStartOfDay().atZone(ZoneId.systemDefault())
.toInstant().toEpochMilli()
"{\"\$date\":{\"\$numberLong\":\"$millis\"}}"
val millis = try{
LocalDate.of(year.value, month.value, day.value).atStartOfDay().atZone(ZoneId.systemDefault())
.toInstant().toEpochMilli()
}catch (e : Exception){
//this can happen if date is invalid
-1
}
$$"{\"$date\":{\"$numberLong\":\"$$millis\"}}"
} else {
"\"${getValueAsRawString()}\""
}
Expand Down
Loading