Spring Framework
  1. Spring Framework
  2. SPR-10146

Improve exceptions for multi-operand expressions

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2 GA
    • Fix Version/s: 3.2.1
    • Component/s: Core:SpEL
    • Labels:
      None

      Description

      Malformed SpEL Expression causes an NPE...

      new SpelExpressionParser().parseExpression("/foo");

      
      Exception in thread "main" java.lang.NullPointerException
      	at org.springframework.expression.spel.ast.SpelNodeImpl.<init>(SpelNodeImpl.java:50)
      	at org.springframework.expression.spel.ast.Operator.<init>(Operator.java:32)
      	at org.springframework.expression.spel.ast.OpDivide.<init>(OpDivide.java:34)
      	at org.springframework.expression.spel.standard.InternalSpelExpressionParser.eatProductExpression(InternalSpelExpressionParser.java:224)
      ...
      

      (null left operand for divide operator).

        Activity

        Hide
        Phil Webb added a comment -

        This has been fixed for 3.2.1. Since this is a minor issues I am not planning to backport to 3.1.

        Show
        Phil Webb added a comment - This has been fixed for 3.2.1. Since this is a minor issues I am not planning to backport to 3.1.

          People

          • Assignee:
            Phil Webb
            Reporter:
            Gary Russell
            Last updater:
            Phil Webb
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              1 year, 14 weeks, 3 days ago