454
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1997 by eXept Software AG
|
|
3 |
All Rights Reserved
|
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
|
12 |
|
|
13 |
|
|
14 |
|
1
|
15 |
JavaUnresolvedRefConstant subclass:#JavaUnresolvedMethodrefConstant
|
90
|
16 |
instanceVariableNames:'classIndex'
|
1
|
17 |
classVariableNames:''
|
|
18 |
poolDictionaries:''
|
|
19 |
category:'Java-Reader-Support'
|
|
20 |
!
|
|
21 |
|
454
|
22 |
!JavaUnresolvedMethodrefConstant class methodsFor:'documentation'!
|
|
23 |
|
|
24 |
copyright
|
|
25 |
"
|
|
26 |
COPYRIGHT (c) 1997 by eXept Software AG
|
|
27 |
All Rights Reserved
|
|
28 |
|
|
29 |
This software is furnished under a license and may be used
|
|
30 |
only in accordance with the terms of that license and with the
|
|
31 |
inclusion of the above copyright notice. This software may not
|
|
32 |
be provided or otherwise made available to, or used by, any
|
|
33 |
other person. No title to or ownership of the software is
|
|
34 |
hereby transferred.
|
|
35 |
"
|
|
36 |
|
|
37 |
|
|
38 |
! !
|
1
|
39 |
|
135
|
40 |
!JavaUnresolvedMethodrefConstant class methodsFor:'instance creation'!
|
90
|
41 |
|
|
42 |
pool:aPool poolIndex:idx classIndex:cIdx nameandTypeIndex:nmIdx
|
|
43 |
^ self new
|
|
44 |
pool:aPool poolIndex:idx classIndex:cIdx nameandTypeIndex:nmIdx
|
|
45 |
! !
|
|
46 |
|
|
47 |
!JavaUnresolvedMethodrefConstant methodsFor:'accessing'!
|
|
48 |
|
163
|
49 |
argSignature
|
|
50 |
|ref cls nameAndType|
|
|
51 |
|
|
52 |
self isUnresolved ifFalse:[
|
|
53 |
self halt
|
|
54 |
].
|
|
55 |
ref := self preResolve.
|
|
56 |
ref isUnresolved ifFalse:[
|
|
57 |
^ ref argSignature
|
|
58 |
].
|
|
59 |
nameAndType := (constantPool at:nameandTypeIndex).
|
|
60 |
nameAndType isUnresolved ifTrue:[
|
|
61 |
nameAndType displayString printCR.
|
|
62 |
].
|
|
63 |
^ JavaMethod argSigArrayFromSignature:(nameAndType signature)
|
|
64 |
|
|
65 |
"Modified: 24.3.1997 / 13:05:57 / cg"
|
|
66 |
!
|
|
67 |
|
|
68 |
javaClass
|
|
69 |
|ref cls|
|
|
70 |
|
|
71 |
self isUnresolved ifFalse:[
|
|
72 |
self halt
|
|
73 |
].
|
|
74 |
ref := self preResolve.
|
|
75 |
ref isUnresolved ifFalse:[
|
|
76 |
^ ref javaClass
|
|
77 |
].
|
|
78 |
cls := constantPool at:classIndex.
|
|
79 |
^ cls
|
|
80 |
|
|
81 |
"Created: 24.3.1997 / 13:03:59 / cg"
|
|
82 |
!
|
|
83 |
|
|
84 |
method
|
|
85 |
|ref cls nameAndType|
|
|
86 |
|
|
87 |
self isUnresolved ifTrue:[
|
|
88 |
ref := self preResolve.
|
|
89 |
ref isUnresolved ifFalse:[
|
|
90 |
^ ref method
|
|
91 |
].
|
|
92 |
(cls := constantPool at:classIndex) isUnresolved ifTrue:[
|
|
93 |
cls displayString printCR.
|
|
94 |
].
|
|
95 |
nameAndType := (constantPool at:nameandTypeIndex).
|
|
96 |
nameAndType isUnresolved ifTrue:[
|
|
97 |
nameAndType displayString printCR.
|
|
98 |
].
|
|
99 |
].
|
|
100 |
('unresolved mthod: ' , self displayString) printCR.
|
|
101 |
^ self
|
|
102 |
|
|
103 |
"Modified: 24.3.1997 / 13:02:56 / cg"
|
|
104 |
!
|
|
105 |
|
|
106 |
name
|
|
107 |
|ref cls nameAndType|
|
|
108 |
|
|
109 |
self isUnresolved ifFalse:[
|
|
110 |
self halt
|
|
111 |
].
|
|
112 |
ref := self preResolve.
|
|
113 |
ref isUnresolved ifFalse:[
|
|
114 |
^ ref name
|
|
115 |
].
|
|
116 |
nameAndType := (constantPool at:nameandTypeIndex).
|
|
117 |
nameAndType isUnresolved ifTrue:[
|
|
118 |
nameAndType displayString printCR.
|
|
119 |
].
|
|
120 |
^ nameAndType name
|
|
121 |
|
|
122 |
"Modified: 24.3.1997 / 13:05:57 / cg"
|
|
123 |
"Created: 24.3.1997 / 13:06:58 / cg"
|
|
124 |
!
|
|
125 |
|
90
|
126 |
pool:aPool poolIndex:idx classIndex:cIdx nameandTypeIndex:nmIdx
|
|
127 |
constantPool := aPool.
|
|
128 |
constantPoolIndex := idx.
|
|
129 |
classIndex := cIdx.
|
|
130 |
nameandTypeIndex := nmIdx
|
|
131 |
|
163
|
132 |
!
|
|
133 |
|
|
134 |
returnType
|
|
135 |
|ref cls nameAndType|
|
|
136 |
|
|
137 |
self isUnresolved ifFalse:[
|
|
138 |
self halt
|
|
139 |
].
|
|
140 |
ref := self preResolve.
|
|
141 |
ref isUnresolved ifFalse:[
|
|
142 |
^ ref returnType
|
|
143 |
].
|
|
144 |
nameAndType := (constantPool at:nameandTypeIndex).
|
|
145 |
nameAndType isUnresolved ifTrue:[
|
|
146 |
nameAndType displayString printCR.
|
|
147 |
].
|
255
|
148 |
^ JavaMethod returnTypeFromSignature:(nameAndType signature) in:nil.
|
163
|
149 |
|
255
|
150 |
"Created: / 24.3.1997 / 13:07:45 / cg"
|
|
151 |
"Modified: / 8.1.1998 / 19:07:47 / cg"
|
90
|
152 |
! !
|
|
153 |
|
399
|
154 |
!JavaUnresolvedMethodrefConstant methodsFor:'queries'!
|
|
155 |
|
|
156 |
isUnresolvedMethod
|
|
157 |
^ true
|
|
158 |
|
|
159 |
"Created: / 20.10.1998 / 17:43:19 / cg"
|
|
160 |
! !
|
|
161 |
|
1
|
162 |
!JavaUnresolvedMethodrefConstant methodsFor:'resolving'!
|
|
163 |
|
90
|
164 |
preResolve
|
|
165 |
|nameAndType class ref|
|
|
166 |
|
|
167 |
"/ first, resolve the nameAndType & signature ...
|
1
|
168 |
|
90
|
169 |
class := (constantPool at:classIndex).
|
|
170 |
class isUnresolved ifTrue:[
|
|
171 |
class := class preResolve.
|
|
172 |
].
|
|
173 |
class isUnresolved ifFalse:[
|
|
174 |
nameAndType := (constantPool at:nameandTypeIndex).
|
|
175 |
nameAndType isUnresolved ifTrue:[
|
|
176 |
nameAndType := nameAndType preResolve.
|
|
177 |
].
|
|
178 |
nameAndType isUnresolved ifFalse:[
|
|
179 |
"/ ok, got them
|
1
|
180 |
|
90
|
181 |
ref := JavaMethodref class:class nameandType:nameAndType.
|
|
182 |
constantPool at:constantPoolIndex put:ref.
|
|
183 |
^ ref
|
|
184 |
]
|
|
185 |
].
|
|
186 |
|
|
187 |
self rememberForResolveWith:(class fullName).
|
|
188 |
^ self
|
|
189 |
|
1
|
190 |
! !
|
|
191 |
|
135
|
192 |
!JavaUnresolvedMethodrefConstant class methodsFor:'documentation'!
|
1
|
193 |
|
|
194 |
version
|
454
|
195 |
^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaUnresolvedMethodrefConstant.st,v 1.10 1998/11/16 15:16:31 cg Exp $'
|
1
|
196 |
! !
|