This could be explained if defVal is null.
With ternary expressions, both options must be of exactly the same type and if not some coercion is applied:
The JLS 15.25 "Conditional operator ? :" says:
If one of the second and third operands is of primitive type T, and the type of the other is the result of applying boxing conversion (§5.1.7) to T, then the type of the conditional expression is T.
In the case of this expression:
val == null ? defVal : "true".equalsIgnoreCase(val)
The Boolean value for defVal is auto-unboxed to match the boolean result of the string comparison. This is despite the fact that the result of the ternary is then auto-boxed back to a Boolean - when deciding how to cast, a ternary does not consider anything outside itself.