JavaClassRef2.st
author Claus Gittinger <cg@exept.de>
Sun, 23 Feb 2020 14:03:15 +0100
branchcvs_MAIN
changeset 3997 5bb44f7e1d20
parent 3607 37260c6e5a4d
permissions -rw-r--r--
#REFACTORING by exept class: Java class changed: #dumpConfigOn:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     1
"
3324
a58245c0e83a Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3196
diff changeset
     2
 COPYRIGHT (c) 1996-2015 by Claus Gittinger
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
     3
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
     4
 New code and modifications done at SWING Research Group [1]:
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
     5
3324
a58245c0e83a Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3196
diff changeset
     6
 COPYRIGHT (c) 2010-2015 by Jan Vrany, Jan Kurs and Marcel Hlopko
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     7
                            SWING Research Group, Czech Technical University in Prague
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     8
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     9
 This software is furnished under a license and may be used
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    10
 only in accordance with the terms of that license and with the
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    11
 inclusion of the above copyright notice.   This software may not
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    12
 be provided or otherwise made available to, or used by, any
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    13
 other person.  No title to or ownership of the software is
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    14
 hereby transferred.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    15
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
    16
 [1] Code written at SWING Research Group contains a signature
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
    17
     of one of the above copright owners. For exact set of such code,
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
    18
     see the differences between this version and version stx:libjava
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
    19
     as of 1.9.2010
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    20
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    21
"{ Package: 'stx:libjava' }"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    22
3607
37260c6e5a4d #OTHER by mawalch
mawalch
parents: 3412
diff changeset
    23
"{ NameSpace: Smalltalk }"
37260c6e5a4d #OTHER by mawalch
mawalch
parents: 3412
diff changeset
    24
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    25
JavaRef2 subclass:#JavaClassRef2
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    26
	instanceVariableNames:'nameIndex'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    27
	classVariableNames:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    28
	poolDictionaries:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    29
	category:'Languages-Java-Reader-Support-new'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    30
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    31
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    32
!JavaClassRef2 class methodsFor:'documentation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    33
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    34
copyright
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    35
"
3324
a58245c0e83a Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3196
diff changeset
    36
 COPYRIGHT (c) 1996-2015 by Claus Gittinger
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
    37
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
    38
 New code and modifications done at SWING Research Group [1]:
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
    39
3324
a58245c0e83a Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3196
diff changeset
    40
 COPYRIGHT (c) 2010-2015 by Jan Vrany, Jan Kurs and Marcel Hlopko
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    41
                            SWING Research Group, Czech Technical University in Prague
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    42
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    43
 This software is furnished under a license and may be used
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    44
 only in accordance with the terms of that license and with the
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    45
 inclusion of the above copyright notice.   This software may not
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    46
 be provided or otherwise made available to, or used by, any
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    47
 other person.  No title to or ownership of the software is
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    48
 hereby transferred.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    49
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
    50
 [1] Code written at SWING Research Group contains a signature
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
    51
     of one of the above copright owners. For exact set of such code,
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
    52
     see the differences between this version and version stx:libjava
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
    53
     as of 1.9.2010
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    54
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    55
"
2992
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    56
!
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    57
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    58
documentation
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    59
"
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    60
    A symbolic reference to a class.
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    61
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    62
    [author:]
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    63
        Marcel Hlopko <marcel.hlopko@fit.cvut.cz>
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    64
        Jan Vrany <jan.vrany@fit.cvut.cz>
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    65
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    66
    [instance variables:]
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    67
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    68
    [class variables:]
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    69
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    70
    [see also:]
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    71
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
    72
"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    73
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    74
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    75
!JavaClassRef2 class methodsFor:'instance creation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    76
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    77
in: aJavaConstantPool withNameAt: nameIndex
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    78
    ^ self basicNew initializeIn: aJavaConstantPool withNameAt: nameIndex.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    79
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    80
    "Created: / 10-05-2011 / 14:56:15 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
    81
    "Modified (format): / 28-09-2012 / 23:01:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    82
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    83
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    84
!JavaClassRef2 methodsFor:'accessing'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    85
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    86
classLoader
3196
d617b4590431 (Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3088
diff changeset
    87
    self owner isNil ifTrue:[
d617b4590431 (Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3088
diff changeset
    88
        ^ nil
d617b4590431 (Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3088
diff changeset
    89
    ] ifFalse:[
d617b4590431 (Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3088
diff changeset
    90
        ^ self owner classLoader
d617b4590431 (Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3088
diff changeset
    91
    ].
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    92
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    93
    "Created: / 11-04-2011 / 21:52:06 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    94
    "Modified: / 12-05-2011 / 18:32:57 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
3196
d617b4590431 (Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3088
diff changeset
    95
    "Modified: / 04-08-2014 / 15:50:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    96
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    97
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
    98
displayString
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
    99
    ^self name.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   100
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   101
    "Created: / 01-11-2011 / 15:29:00 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   102
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   103
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   104
fullName
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   105
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   106
    ^self javaClassName
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   107
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   108
    "Created: / 08-04-2011 / 13:48:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   109
    "Modified: / 13-05-2011 / 09:59:58 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   110
    "Created: / 30-10-2011 / 22:00:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   111
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   112
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   113
javaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   114
2992
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
   115
    resolvedValue isNil ifTrue:[self resolve: false].
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
   116
    ^resolvedValue
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   117
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   118
    "Created: / 22-05-2011 / 14:02:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2678
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2396
diff changeset
   119
    "Modified: / 31-08-2013 / 10:59:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   120
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   121
2819
76893aac6a7e add JavaFieldRef>>reresolveForVersion: javaClass
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 2794
diff changeset
   122
javaClass: javaClass
76893aac6a7e add JavaFieldRef>>reresolveForVersion: javaClass
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 2794
diff changeset
   123
2992
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
   124
    resolvedValue := javaClass.
2819
76893aac6a7e add JavaFieldRef>>reresolveForVersion: javaClass
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 2794
diff changeset
   125
76893aac6a7e add JavaFieldRef>>reresolveForVersion: javaClass
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 2794
diff changeset
   126
    "Created: / 12-10-2013 / 15:43:45 / Marcel Hlopko <marcel.hlopko@fit.cvut.cz>"
76893aac6a7e add JavaFieldRef>>reresolveForVersion: javaClass
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 2794
diff changeset
   127
!
76893aac6a7e add JavaFieldRef>>reresolveForVersion: javaClass
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 2794
diff changeset
   128
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   129
javaClassName
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   130
    "return java class name as written in java programs e.g. java.util.String
2793
f3cfee185a72 Fix for GroovyEvaluator
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2731
diff changeset
   131
     in case of array, return class name without square brackets. For primitive
f3cfee185a72 Fix for GroovyEvaluator
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2731
diff changeset
   132
     types, it returns nil. "
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   133
    
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   134
    | tmp |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   135
2793
f3cfee185a72 Fix for GroovyEvaluator
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2731
diff changeset
   136
    "/ Argh, this implementation is rubbish!! Use indices to avoid 
f3cfee185a72 Fix for GroovyEvaluator
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2731
diff changeset
   137
    "/ copying strings every now and again.
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   138
    tmp := self name copy.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   139
    [ tmp startsWith: '[' ] whileTrue: [ tmp := tmp copyFrom: 2 ].
2793
f3cfee185a72 Fix for GroovyEvaluator
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2731
diff changeset
   140
    tmp size == 1 ifTrue:[ ^ nil ].
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   141
    tmp := tmp replaceAll: $/ with: $..
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   142
    (tmp startsWith: 'L') ifTrue: [ tmp := tmp copyFrom: 2 to: tmp size ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   143
    (tmp endsWith: ';') ifTrue: [ tmp := tmp copyFrom: 1 to: tmp size - 1 ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   144
    ^ tmp.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   145
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   146
    "Created: / 08-04-2011 / 18:30:44 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   147
    "Modified: / 23-05-2011 / 15:30:01 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2793
f3cfee185a72 Fix for GroovyEvaluator
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2731
diff changeset
   148
    "Modified (format): / 04-10-2013 / 21:31:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   149
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   150
2794
cec025d0f359 Oops, fix for resolving.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2793
diff changeset
   151
javaClassNameOrPrimitiveTypeId
cec025d0f359 Oops, fix for resolving.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2793
diff changeset
   152
    "return java class name as written in java programs e.g. java.util.String
cec025d0f359 Oops, fix for resolving.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2793
diff changeset
   153
     in case of array, return class name without square brackets."
cec025d0f359 Oops, fix for resolving.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2793
diff changeset
   154
    
cec025d0f359 Oops, fix for resolving.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2793
diff changeset
   155
    | tmp |
cec025d0f359 Oops, fix for resolving.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2793
diff changeset
   156
cec025d0f359 Oops, fix for resolving.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2793
diff changeset
   157
    "/ Argh, this implementation is rubbish!! Use indices to avoid 
cec025d0f359 Oops, fix for resolving.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2793
diff changeset
   158
    "/ copying strings every now and again.
cec025d0f359 Oops, fix for resolving.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2793
diff changeset
   159
    tmp := self name copy.
cec025d0f359 Oops, fix for resolving.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2793
diff changeset
   160
    [ tmp startsWith: '[' ] whileTrue: [ tmp := tmp copyFrom: 2 ].
cec025d0f359 Oops, fix for resolving.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2793
diff changeset
   161
    tmp := tmp replaceAll: $/ with: $..
cec025d0f359 Oops, fix for resolving.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2793
diff changeset
   162
    (tmp startsWith: 'L') ifTrue: [ tmp := tmp copyFrom: 2 to: tmp size ].
cec025d0f359 Oops, fix for resolving.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2793
diff changeset
   163
    (tmp endsWith: ';') ifTrue: [ tmp := tmp copyFrom: 1 to: tmp size - 1 ].
cec025d0f359 Oops, fix for resolving.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2793
diff changeset
   164
    ^ tmp.
cec025d0f359 Oops, fix for resolving.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2793
diff changeset
   165
cec025d0f359 Oops, fix for resolving.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2793
diff changeset
   166
    "Created: / 05-10-2013 / 01:05:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
cec025d0f359 Oops, fix for resolving.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2793
diff changeset
   167
!
cec025d0f359 Oops, fix for resolving.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2793
diff changeset
   168
3088
54211576c9ce JavaClassRef2:
Claus Gittinger
parents: 2992
diff changeset
   169
javaName
54211576c9ce JavaClassRef2:
Claus Gittinger
parents: 2992
diff changeset
   170
    ^ self javaClassName
54211576c9ce JavaClassRef2:
Claus Gittinger
parents: 2992
diff changeset
   171
!
54211576c9ce JavaClassRef2:
Claus Gittinger
parents: 2992
diff changeset
   172
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   173
name
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   174
    ^constantPool at: nameIndex.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   175
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   176
    "Created: / 08-04-2011 / 13:48:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   177
    "Modified: / 13-05-2011 / 09:59:58 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   178
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   179
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   180
!JavaClassRef2 methodsFor:'array support'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   181
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   182
arrayDimensions
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   183
    ^ self name occurrencesOf: $[.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   184
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   185
    "Created: / 08-04-2011 / 18:42:02 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   186
    "Modified: / 13-05-2011 / 10:00:15 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   187
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   188
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   189
isJavaArrayClassRef
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   190
    ^ self name startsWith: '['.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   191
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   192
    "Created: / 08-04-2011 / 18:40:40 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   193
    "Modified: / 13-05-2011 / 10:00:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   194
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   195
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   196
!JavaClassRef2 methodsFor:'comparing'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   197
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   198
= anotherJavaClassRef 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   199
    "superclass JavaRef2 says that I am responsible to implement this method"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   200
    
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   201
    anotherJavaClassRef isJavaClassRef ifFalse: [ ^ false ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   202
    ^ self name = anotherJavaClassRef name.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   203
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   204
    "Modified: / 08-04-2011 / 13:48:56 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   205
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   206
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   207
hash
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   208
    ^ self name hash.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   209
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   210
    "Modified: / 13-05-2011 / 10:00:26 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   211
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   212
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   213
!JavaClassRef2 methodsFor:'initialization'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   214
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   215
initializeIn: aJavaConstantPool withNameAt: nameCPIndex
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   216
    nameIndex := nameCPIndex.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   217
    constantPool := aJavaConstantPool.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   218
    super initialize.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   219
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   220
    "Modified: / 10-05-2011 / 14:57:38 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   221
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   222
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   223
!JavaClassRef2 methodsFor:'printing & storing'!
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   224
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   225
printOn:aStream
3607
37260c6e5a4d #OTHER by mawalch
mawalch
parents: 3412
diff changeset
   226
    "append a printed representation of the receiver to the argument, aStream"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   227
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   228
    super printOn:aStream.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   229
    aStream nextPut:$(.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   230
    self name printOn: aStream.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   231
    aStream nextPut:$).
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   232
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   233
    "Modified: / 30-10-2011 / 21:59:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   234
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   235
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   236
!JavaClassRef2 methodsFor:'private - resolving'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   237
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   238
findResolvedStaticValue
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   239
    "Resolving static inner classes is not different from resolving any other class, it's only done in different circumstances"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   240
    
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   241
    ^ self findResolvedValue.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   242
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   243
    "Created: / 28-04-2011 / 21:57:46 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   244
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   245
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   246
findResolvedValue
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   247
    "Resolve reference and set valueCache."
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   248
    
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   249
    self findResolvedValue: true
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   250
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   251
    "Modified: / 08-04-2011 / 17:39:03 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   252
    "Modified: / 21-10-2011 / 10:58:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   253
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   254
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   255
findResolvedValue: doInit
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   256
    "Resolve reference and set valueCache."
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   257
    
2992
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2976
diff changeset
   258
    resolvedValue := JavaResolver uniqueInstance 
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   259
                resolveClassIndentifiedByRef: self init: doInit.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   260
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   261
    "Modified: / 08-04-2011 / 17:39:03 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   262
    "Created: / 12-08-2011 / 22:19:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2827
b9fadb7c9a1f move resolveForVersion moved to JavaClassRef2
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 2819
diff changeset
   263
!
b9fadb7c9a1f move resolveForVersion moved to JavaClassRef2
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 2819
diff changeset
   264
b9fadb7c9a1f move resolveForVersion moved to JavaClassRef2
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 2819
diff changeset
   265
resolveForVersionOf: javaObj or: otherJavaObj
2828
a141e4ea784d ensure JavaClassRef2>>resolveForVersionOf:or: chooses class specified by the reference
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 2827
diff changeset
   266
    | matchingClass |
2827
b9fadb7c9a1f move resolveForVersion moved to JavaClassRef2
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 2819
diff changeset
   267
    "
b9fadb7c9a1f move resolveForVersion moved to JavaClassRef2
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 2819
diff changeset
   268
    this method is called by the vm when there are multiple
b9fadb7c9a1f move resolveForVersion moved to JavaClassRef2
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 2819
diff changeset
   269
    class versions and we need to get a handle of the correct
b9fadb7c9a1f move resolveForVersion moved to JavaClassRef2
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 2819
diff changeset
   270
    one. javaObj an otherJavaObj contain reference to the 
b9fadb7c9a1f move resolveForVersion moved to JavaClassRef2
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 2819
diff changeset
   271
    object in question, the other one is DUMMYLONGWORD or trash.
b9fadb7c9a1f move resolveForVersion moved to JavaClassRef2
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 2819
diff changeset
   272
    "    
b9fadb7c9a1f move resolveForVersion moved to JavaClassRef2
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 2819
diff changeset
   273
    self findResolvedValue: true.
2828
a141e4ea784d ensure JavaClassRef2>>resolveForVersionOf:or: chooses class specified by the reference
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 2827
diff changeset
   274
    matchingClass := javaObj class.
a141e4ea784d ensure JavaClassRef2>>resolveForVersionOf:or: chooses class specified by the reference
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 2827
diff changeset
   275
    [ matchingClass notNil and: [ matchingClass name ~= self javaClass name ]] whileTrue: [
a141e4ea784d ensure JavaClassRef2>>resolveForVersionOf:or: chooses class specified by the reference
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 2827
diff changeset
   276
        matchingClass := matchingClass superclass.
a141e4ea784d ensure JavaClassRef2>>resolveForVersionOf:or: chooses class specified by the reference
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 2827
diff changeset
   277
    ].
a141e4ea784d ensure JavaClassRef2>>resolveForVersionOf:or: chooses class specified by the reference
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 2827
diff changeset
   278
    matchingClass isNil ifTrue: [ self error: 'error in get/pufield, object is not of expected type'. ] ifFalse: [
a141e4ea784d ensure JavaClassRef2>>resolveForVersionOf:or: chooses class specified by the reference
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 2827
diff changeset
   279
        self javaClass: javaObj class.    
2827
b9fadb7c9a1f move resolveForVersion moved to JavaClassRef2
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 2819
diff changeset
   280
    ].
b9fadb7c9a1f move resolveForVersion moved to JavaClassRef2
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 2819
diff changeset
   281
b9fadb7c9a1f move resolveForVersion moved to JavaClassRef2
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 2819
diff changeset
   282
    "Created: / 13-10-2013 / 12:33:08 / Marcel Hlopko <marcel.hlopko@fit.cvut.cz>"
2828
a141e4ea784d ensure JavaClassRef2>>resolveForVersionOf:or: chooses class specified by the reference
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 2827
diff changeset
   283
    "Modified: / 13-10-2013 / 16:13:51 / Marcel Hlopko <marcel.hlopko@fit.cvut.cz>"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   284
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   285
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   286
!JavaClassRef2 methodsFor:'queries'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   287
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   288
isJavaClassOrStringRef
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   289
    ^ true.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   290
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   291
    "Created: / 11-04-2011 / 19:10:00 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   292
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   293
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   294
isJavaClassRef
2678
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2396
diff changeset
   295
    ^true.
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   296
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   297
    "Created: / 11-04-2011 / 19:10:00 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2678
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2396
diff changeset
   298
    "Modified (format): / 30-08-2013 / 00:42:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   299
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   300
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   301
!JavaClassRef2 methodsFor:'resolving'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   302
2976
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2828
diff changeset
   303
invalidateForClass: internalJavaClassName 
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2828
diff changeset
   304
    "Invalidates receiver iff it refers (even indirectly)
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2828
diff changeset
   305
     to a class ref that has been resolved to given class.
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2828
diff changeset
   306
     Returns true, if the receiver has been invalidated,
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2828
diff changeset
   307
     false otherwise"
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2828
diff changeset
   308
    
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2828
diff changeset
   309
    self name = internalJavaClassName ifTrue: [
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2828
diff changeset
   310
        self invalidate.
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2828
diff changeset
   311
        ^ true
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2828
diff changeset
   312
    ].
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2828
diff changeset
   313
    ^ false.
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2828
diff changeset
   314
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2828
diff changeset
   315
    "Modified: / 23-05-2011 / 15:21:20 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
a384a02381c0 Update JavaLookup to work with new JIT-compilation scheme...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2828
diff changeset
   316
    "Modified (format): / 21-02-2012 / 10:21:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   317
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   318
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   319
!JavaClassRef2 class methodsFor:'documentation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   320
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   321
version_CVS
3607
37260c6e5a4d #OTHER by mawalch
mawalch
parents: 3412
diff changeset
   322
    ^ '$Header$'
2299
5422b4bc941d fixed: #version_SVN ($ to §)
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
   323
!
5422b4bc941d fixed: #version_SVN ($ to §)
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
   324
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   325
version_HG
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   326
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   327
    ^ '$Changeset: <not expanded> $'
2226
68aa19abb50e added: #version_CVS
Claus Gittinger <cg@exept.de>
parents: 2152
diff changeset
   328
!
68aa19abb50e added: #version_CVS
Claus Gittinger <cg@exept.de>
parents: 2152
diff changeset
   329
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   330
version_SVN
3607
37260c6e5a4d #OTHER by mawalch
mawalch
parents: 3412
diff changeset
   331
    ^ '$Id$'
2152
1cbdfbcc685c Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 749
diff changeset
   332
! !
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2299
diff changeset
   333