Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Prabhu Subramanian <[email protected]>
  • Loading branch information
prabhu committed Jan 17, 2024
1 parent 677088b commit ff2b189
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,8 @@ class JavaTypeRecoveryPassTests extends JavaSrcCode2CpgFixture(enableTypeRecover

"hint that `transaction` may be of the null type" in {
val Some(transaction) = cpg.identifier("transaction").headOption: @unchecked
transaction.dynamicTypeHintFullName.contains("null")
transaction.typeFullName shouldBe "org.hibernate.Transaction"
transaction.dynamicTypeHintFullName.contains("null")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,7 @@ abstract class RecoverForXCompilationUnit[CompilationUnitType <: AstNode](
if types.size == 1 then
builder.setNodeProperty(n, PropertyNames.TYPE_FULL_NAME, types.head)
builder.setNodeProperty(n, PropertyNames.DYNAMIC_TYPE_HINT_FULL_NAME, Seq.empty)
else if types.size == 2 then
else if types.size == 2 && types.last.nonEmpty && types.last != "null" then
builder.setNodeProperty(n, PropertyNames.TYPE_FULL_NAME, types.last)
builder.setNodeProperty(n, PropertyNames.DYNAMIC_TYPE_HINT_FULL_NAME, Seq(types.head))
else builder.setNodeProperty(n, PropertyNames.DYNAMIC_TYPE_HINT_FULL_NAME, types)
Expand Down

0 comments on commit ff2b189

Please sign in to comment.