Issue222872

classification
Title: java.lang.Class instance strange behaviour
Type: Severity: normal
Components: Core Versions:
Milestone:
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: bckfnn
Priority: low Keywords:

Created on 2000-11-18.19:45:06 by bckfnn, last changed 2000-11-18.23:22:35 by bckfnn.

Messages
msg193 (view) Author: Finn Bock (bckfnn) Date: 2000-11-18.19:45:06
Some instances of class "java.lang.Class" have strange behaviour. Method calls
to them act as static method calls that require the extra "self" argument. 
To reproduce the problem:

>>> from java.lang import *
>>> cls = Class.forName("java.lang.Class")
>>> cls.getName()
Traceback (innermost last):
  File "<console>", line 1, in ?
TypeError: getName(): expected 1 args; got 0
>>> cls.getName(cls)
'java.lang.Class'
>>>

I encountered this bug in both Blackdown's and Sun's latest version of jdk1.2, 
and  Sun's jdk1.3beta, all on Linux. The JIT compiler has been turned off.

msg194 (view) Author: Finn Bock (bckfnn) Date: 2000-11-18.23:22:35
Not a bug. JPython doesn't have separate class/instance namespaces. The workaround is to use java.lang.Class.getName(cls)
History
Date User Action Args
2000-11-18 19:45:06bckfnncreate