jsr341-experts@el-spec.java.net

[jsr341-experts] instanceof operator & array.length

From: Kin-man Chung <kinman.chung_at_oracle.com>
Date: Wed, 12 Oct 2011 18:02:16 -0700

Looking over the EL RFEs that we have been accumulating over the years,
I note the instanceof operator and the array length attribute were
requested multiple times.

Since we already have the syntax for a class, the syntax for the
instanceof operator can look like

     obj instanceof T(java.lang.String)

BTW, "instanceof" is already a reserved word.

In java, one can get the length of an array "a" with the syntax
a.length, and some users want that for EL. Since "length" is neither a
field nor a function, it'll need special treatment for it to work in
EL. We can, for instance, hack ArrayELResolver to look out the property
"length" and return the array's length, so the change would be
relatively minor.

Do you think we should add them for this release?

Kin-man