Skip to content

Commit

Permalink
change back the order in isAssignableFrom
Browse files Browse the repository at this point in the history
  • Loading branch information
Pawel Czajka committed Jan 15, 2025
1 parent 580a546 commit a5f825f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,10 @@ private[spel] class Typer(
def typeIndexer(e: Indexer, typingResult: TypingResult): NodeTypingResult = {
typingResult match {
case TypedClass(clazz, param :: Nil)
if classOf[java.util.List[_]].isAssignableFrom(clazz) || classOf[Array[Object]].isAssignableFrom(clazz) =>
if clazz.isAssignableFrom(classOf[java.util.List[_]]) || clazz.isAssignableFrom(classOf[Array[Object]]) =>
// TODO: validate indexer key - the only valid key is an integer - but its more complicated with references
withTypedChildren(_ => valid(param))
case TypedClass(clazz, keyParam :: valueParam :: Nil) if classOf[java.util.Map[_, _]].isAssignableFrom(clazz) =>
case TypedClass(clazz, keyParam :: valueParam :: Nil) if clazz.isAssignableFrom(classOf[java.util.Map[_, _]]) =>
withTypedChildren {
// Spel implementation of map indexer (in class org.springframework.expression.spel.ast.Indexer, line 154) tries to convert
// indexer to key type of map, but this conversion can be accomplished only if key type of map is known to spel.
Expand Down

0 comments on commit a5f825f

Please sign in to comment.