A DESCRIPTION OF THE PROBLEM :
The following JShell script shows what I'm seeing.
I would expect the last statement to simple evaluate to false and not generate an exception
jshell> Integer a;
a ==> null
jshell> Integer b=1;
b ==> 1
jshell> a instanceof Integer
$3 ==> false
jshell> b instanceof Integer
$4 ==> true
jshell> b instanceof Double
| Error:
| incompatible types: java.lang.Integer cannot be converted to java.lang.Double
| b instanceof Double
| ^
FREQUENCY : always
The following JShell script shows what I'm seeing.
I would expect the last statement to simple evaluate to false and not generate an exception
jshell> Integer a;
a ==> null
jshell> Integer b=1;
b ==> 1
jshell> a instanceof Integer
$3 ==> false
jshell> b instanceof Integer
$4 ==> true
jshell> b instanceof Double
| Error:
| incompatible types: java.lang.Integer cannot be converted to java.lang.Double
| b instanceof Double
| ^
FREQUENCY : always