camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Sharpe <david.andrew.sha...@gmail.com>
Subject Referring to non-existent enum in simple expression results in null instead of error
Date Wed, 27 Jul 2016 19:52:40 GMT
Hi everyone,

In the Camel documentation for the simple expression language
<http://camel.apache.org/simple.html> I learned that I can refer to enums.
I used this to pass an enum to some bean in my route. Here is a snippet of
Java DSL:

    .bean(SomeBean.class, "process(*,
${type:package.SomeEnumType.SOME_ENUM})")

This works, but I discovered that if SOME_ENUM does not exist, then
SomeBean::process
receives "null" as an input parameter.

This surprised me. I expected there to be some sort of simple expression
interpreter error, "Cannot find SOME_ENUM" or something like that. Is there
some way I can enforce that the enum value must exist? I've added a null
check to my bean, but I'm surprised it's necessary.

Does this sound like a bug?

Regards,
David

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message