United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 4074494 (jni) instanceof doesn't match specification
4074494 : (jni) instanceof doesn't match specification

Details
Type:
Bug
Submit Date:
1997-08-26
Status:
Closed
Updated Date:
2000-02-29
Project Name:
JDK
Resolved Date:
2000-02-29
Component:
hotspot
OS:
windows_nt
Sub-Component:
runtime
CPU:
x86
Priority:
P4
Resolution:
Not an Issue
Affected Versions:
1.1.2,1.2.0
Fixed Versions:

Related Reports
Duplicate:

Sub Tasks

Description

Name: joT67522			Date: 08/26/97


jEnv->IsInstanceOf(null,jEnv->FindClass("[B"))
returns true. Indeed the is_instance_of code in interpreter says that
"since null can be cast to any object return true".
(In my case the null is the value of some object field.)

This appears to be contrary to the language spec:
JLS 1.0 section 15.19.2 states
(where syntax is 'RelationalExpression instanceof ReferenceType'):

"the result of the instanceof operator is true if the value of the
RelationalExpression is not null and the reference could be cast to
the ReferenceType without raising a ClassCastException. Otherwise
the result is false."


company - Adobe Systems , email - ###@###.###
======================================================================

                                    

Comments
WORK AROUND



Name: joT67522			Date: 08/26/97


I wish.
======================================================================
                                     
2004-06-11
EVALUATION

The 1.1 behavior is wrong. However, changing it may break code. We
need to decide what to do my 1.2 shipping date.

sheng.liang@Eng 1997-11-07

Fixed in spec. Per CQI meeting
mohammad.gharahgouzloo@Eng 2000-02-29
                                     
1997-11-07



Hardware and Software, Engineered to Work Together