Browse Source

Merge pull request #1151 from sylvainlaurent:patch-1

* pr/1151:
  Fix class literal in instanceof
pull/1153/head
Stephane Nicoll 10 years ago
parent
commit
749ee6065c
  1. 4
      src/asciidoc/core-expressions.adoc

4
src/asciidoc/core-expressions.adoc

@ -785,7 +785,7 @@ expression based `matches` operator. @@ -785,7 +785,7 @@ expression based `matches` operator.
----
// evaluates to false
boolean falseValue = parser.parseExpression(
"'xyz' instanceof T(Integer.class)").getValue(Boolean.class);
"'xyz' instanceof T(Integer)").getValue(Boolean.class);
// evaluates to true
boolean trueValue = parser.parseExpression(
@ -799,7 +799,7 @@ expression based `matches` operator. @@ -799,7 +799,7 @@ expression based `matches` operator.
[NOTE]
====
Be careful with primitive types as they are immediately boxed up to the wrapper type,
so `1 instanceof T(int)` evaluates to `false` while `1 instanceof T(Integer.class)`
so `1 instanceof T(int)` evaluates to `false` while `1 instanceof T(Integer)`
evaluates to `true`, as expected.
====

Loading…
Cancel
Save