author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Tue, 11 Jun 2019 22:03:11 +0100 | |
changeset 3914 | 35aa88fa58c1 |
parent 3412 | df11bb428463 |
permissions | -rw-r--r-- |
454 | 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:
2208
diff
changeset
|
3 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2208
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:
2208
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 |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2208
diff
changeset
|
7 |
SWING Research Group, Czech Technical University in Prague |
454 | 8 |
|
9 |
This software is furnished under a license and may be used |
|
10 |
only in accordance with the terms of that license and with the |
|
11 |
inclusion of the above copyright notice. This software may not |
|
12 |
be provided or otherwise made available to, or used by, any |
|
13 |
other person. No title to or ownership of the software is |
|
14 |
hereby transferred. |
|
2151 | 15 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2208
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:
2208
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:
2208
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:
2208
diff
changeset
|
19 |
as of 1.9.2010 |
2151 | 20 |
" |
713 | 21 |
"{ Package: 'stx:libjava' }" |
22 |
||
1 | 23 |
JavaUnresolvedConstant subclass:#JavaUnresolvedClassConstant |
90 | 24 |
instanceVariableNames:'nameIndex fullName' |
1 | 25 |
classVariableNames:'' |
26 |
poolDictionaries:'' |
|
713 | 27 |
category:'Languages-Java-Reader-Support' |
1 | 28 |
! |
29 |
||
454 | 30 |
!JavaUnresolvedClassConstant class methodsFor:'documentation'! |
31 |
||
32 |
copyright |
|
33 |
" |
|
3324
a58245c0e83a
Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
34 |
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:
2208
diff
changeset
|
35 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2208
diff
changeset
|
36 |
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:
2208
diff
changeset
|
37 |
|
3324
a58245c0e83a
Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
38 |
COPYRIGHT (c) 2010-2015 by Jan Vrany, Jan Kurs and Marcel Hlopko |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2208
diff
changeset
|
39 |
SWING Research Group, Czech Technical University in Prague |
454 | 40 |
|
41 |
This software is furnished under a license and may be used |
|
42 |
only in accordance with the terms of that license and with the |
|
43 |
inclusion of the above copyright notice. This software may not |
|
44 |
be provided or otherwise made available to, or used by, any |
|
45 |
other person. No title to or ownership of the software is |
|
46 |
hereby transferred. |
|
2151 | 47 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2208
diff
changeset
|
48 |
[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:
2208
diff
changeset
|
49 |
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:
2208
diff
changeset
|
50 |
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:
2208
diff
changeset
|
51 |
as of 1.9.2010 |
2151 | 52 |
|
53 |
" |
|
454 | 54 |
! ! |
1 | 55 |
|
135 | 56 |
!JavaUnresolvedClassConstant class methodsFor:'instance creation'! |
1 | 57 |
|
54 | 58 |
fullName:nm |
90 | 59 |
|ref| |
60 |
||
61 |
ref := Java unresolvedClassRefFor:nm. |
|
62 |
ref notNil ifTrue:[^ ref]. |
|
63 |
||
2841
6fa1bcf9c997
JavaClass>>#name vs. #binaryName refactoring
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
64 |
ref := self new setBinaryName: nm. |
90 | 65 |
Java rememberUnresolved:ref. |
66 |
^ ref |
|
392 | 67 |
|
68 |
"Modified: / 19.10.1998 / 20:18:13 / cg" |
|
54 | 69 |
! |
70 |
||
313 | 71 |
pool:aPool poolIndex:slotIndex fullName:aString |
72 |
^ self new |
|
73 |
pool:aPool poolIndex:slotIndex fullName:aString |
|
74 |
||
75 |
"Created: / 4.2.1998 / 22:13:13 / cg" |
|
76 |
"Modified: / 4.2.1998 / 22:13:28 / cg" |
|
77 |
! |
|
78 |
||
90 | 79 |
pool:aPool poolIndex:slotIndex nameIndex:index |
313 | 80 |
^ self new |
81 |
pool:aPool poolIndex:slotIndex nameIndex:index |
|
82 |
||
83 |
"Modified: / 4.2.1998 / 22:13:38 / cg" |
|
21 | 84 |
! ! |
85 |
||
2678
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2552
diff
changeset
|
86 |
!JavaUnresolvedClassConstant class methodsFor:'others'! |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2552
diff
changeset
|
87 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2552
diff
changeset
|
88 |
version_HG |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2552
diff
changeset
|
89 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2552
diff
changeset
|
90 |
^ '$Changeset: <not expanded> $' |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2552
diff
changeset
|
91 |
! ! |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2552
diff
changeset
|
92 |
|
2151 | 93 |
!JavaUnresolvedClassConstant methodsFor:'* As yet uncategorized *'! |
94 |
||
95 |
javaClassForNew |
|
96 |
||
97 |
^self javaClass |
|
98 |
||
99 |
"Created: / 16-03-2011 / 16:09:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
100 |
! ! |
|
101 |
||
21 | 102 |
!JavaUnresolvedClassConstant methodsFor:'accessing'! |
103 |
||
67 | 104 |
className |
105 |
|s nm| |
|
106 |
||
107 |
(fullName startsWith:$[) ifTrue:[ |
|
108 |
"/ a ref for newarray or new or checkCast |
|
109 |
||
110 |
s := fullName readStream. |
|
560 | 111 |
[ s peek == $[ ] whileTrue:[ |
112 |
s next. |
|
113 |
]. |
|
255 | 114 |
nm := JavaMethod retvalSpecFromStream:s in:nil. |
67 | 115 |
^ nm |
116 |
]. |
|
117 |
^ fullName |
|
118 |
||
255 | 119 |
"Modified: / 8.1.1998 / 19:11:37 / cg" |
67 | 120 |
! |
121 |
||
168 | 122 |
deref |
271 | 123 |
|refClassName cls| |
124 |
||
125 |
(fullName startsWith:'[L') ifTrue:[ |
|
126 |
refClassName := fullName copyFrom:3 to:(fullName indexOf:$;)-1. |
|
127 |
cls := Java at:refClassName. |
|
128 |
cls notNil ifTrue:[ |
|
129 |
^ cls |
|
130 |
]. |
|
2841
6fa1bcf9c997
JavaClass>>#name vs. #binaryName refactoring
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
131 |
^ JavaUnresolvedClassConstant basicNew setBinaryName: refClassName |
168 | 132 |
]. |
317 | 133 |
(fullName startsWith:'[[C') ifTrue:[ |
134 |
^ JavaBuiltInClassPointerRef new nameandType:'[C'. |
|
135 |
]. |
|
168 | 136 |
|
271 | 137 |
"Created: / 7.4.1997 / 13:38:07 / cg" |
317 | 138 |
"Modified: / 6.2.1998 / 01:21:01 / cg" |
168 | 139 |
! |
140 |
||
21 | 141 |
fullName |
142 |
^ fullName |
|
143 |
||
93 | 144 |
! |
90 | 145 |
|
146 |
javaClass |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2208
diff
changeset
|
147 |
| cls clsName | |
2151 | 148 |
|
149 |
"/fullName first == $[ ifTrue:[self halt]. |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2208
diff
changeset
|
150 |
fullName isNil ifTrue: [ |
399 | 151 |
self preResolve. |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2208
diff
changeset
|
152 |
fullName isNil ifTrue: [ self halt. ] |
90 | 153 |
]. |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2208
diff
changeset
|
154 |
(fullName first = $[) ifTrue: [ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2208
diff
changeset
|
155 |
cls := (JavaDescriptor fromString: fullName) javaClass |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2208
diff
changeset
|
156 |
] ifFalse: [ cls := JavaVM classForName: fullName ]. |
2151 | 157 |
constantPool at: constantPoolIndex put: cls. |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2208
diff
changeset
|
158 |
^ cls |
2151 | 159 |
|
160 |
"old code:" |
|
161 |
" |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2208
diff
changeset
|
162 |
(fullName startsWith:$[) ifTrue:[ |
2151 | 163 |
self halt. |
164 |
clsName := self className. |
|
165 |
(Java classForName:clsName) ifNil: |
|
166 |
[self error: 'Cannot resolve class ' , clsName]. |
|
167 |
cls := (JavaDescriptor fromString: fullName) javaClass. |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2208
diff
changeset
|
168 |
] ifFalse:[ |
431 | 169 |
clsName := fullName |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2208
diff
changeset
|
170 |
]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2208
diff
changeset
|
171 |
cls := Java classForName:clsName. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2208
diff
changeset
|
172 |
constantPool at: constantPoolIndex put: cls. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2208
diff
changeset
|
173 |
^cls" |
2151 | 174 |
"Modified: / 10-11-1998 / 19:29:28 / cg" |
175 |
"Modified: / 11-02-2011 / 07:53:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
176 |
! |
|
177 |
||
178 |
lastName |
|
3196
d617b4590431
(Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2841
diff
changeset
|
179 |
| idx | |
2151 | 180 |
|
3196
d617b4590431
(Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2841
diff
changeset
|
181 |
idx := fullName lastIndexOf:$/. |
d617b4590431
(Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2841
diff
changeset
|
182 |
^ idx isNil ifTrue:[ fullName ] ifFalse:[ fullName copyFrom:idx + 1 ]. |
2151 | 183 |
|
184 |
"Created: / 18-10-2010 / 22:20:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3196
d617b4590431
(Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2841
diff
changeset
|
185 |
"Modified: / 04-08-2014 / 15:50:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
54 | 186 |
! |
187 |
||
136 | 188 |
name |
360 | 189 |
^ fullName copyReplaceAll:$/ with:$. |
136 | 190 |
|
360 | 191 |
"Created: / 7.2.1997 / 23:44:47 / cg" |
192 |
"Modified: / 18.7.1998 / 22:57:47 / cg" |
|
136 | 193 |
! |
194 |
||
313 | 195 |
pool:aPool poolIndex:slotIndex fullName:aString |
196 |
constantPool := aPool. |
|
197 |
constantPoolIndex := slotIndex. |
|
198 |
fullName := aString. |
|
199 |
||
200 |
"Created: / 4.2.1998 / 22:15:22 / cg" |
|
201 |
! |
|
202 |
||
90 | 203 |
pool:aPool poolIndex:slotIndex nameIndex:name_index |
204 |
constantPool := aPool. |
|
205 |
constantPoolIndex := slotIndex. |
|
206 |
nameIndex := name_index. |
|
21 | 207 |
|
168 | 208 |
! |
209 |
||
2841
6fa1bcf9c997
JavaClass>>#name vs. #binaryName refactoring
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
210 |
setBinaryName: aNameString |
168 | 211 |
fullName := aNameString |
212 |
||
213 |
"Created: 7.4.1997 / 13:37:45 / cg" |
|
214 |
! |
|
215 |
||
216 |
smalltalkArrayClass |
|
217 |
(fullName startsWith:'[[') ifTrue:[ |
|
218 |
^ Array |
|
219 |
]. |
|
220 |
(fullName startsWith:'[F') ifTrue:[ |
|
221 |
^ FloatArray |
|
222 |
]. |
|
223 |
(fullName startsWith:'[B') ifTrue:[ |
|
224 |
^ ByteArray |
|
225 |
]. |
|
226 |
self halt. |
|
227 |
||
228 |
"Created: 7.4.1997 / 13:35:25 / cg" |
|
229 |
! ! |
|
230 |
||
231 |
!JavaUnresolvedClassConstant methodsFor:'converting'! |
|
232 |
||
233 |
asClassPointerRef |
|
234 |
(fullName startsWith:'[[') ifTrue:[ |
|
235 |
^ JavaClassPointerRef class:Array nameandType:fullName |
|
236 |
]. |
|
237 |
(fullName startsWith:'[F') ifTrue:[ |
|
238 |
^ JavaClassPointerRef class:FloatArray nameandType:fullName |
|
239 |
]. |
|
240 |
(fullName startsWith:'[B') ifTrue:[ |
|
241 |
^ JavaClassPointerRef class:ByteArray nameandType:fullName |
|
242 |
]. |
|
271 | 243 |
(fullName startsWith:'[C') ifTrue:[ |
244 |
^ JavaClassPointerRef class:String nameandType:fullName |
|
245 |
]. |
|
168 | 246 |
self halt. |
247 |
||
271 | 248 |
"Created: / 7.4.1997 / 13:40:29 / cg" |
249 |
"Modified: / 25.1.1998 / 19:56:54 / cg" |
|
1 | 250 |
! ! |
251 |
||
41 | 252 |
!JavaUnresolvedClassConstant methodsFor:'printing & storing'! |
253 |
||
254 |
displayString |
|
52 | 255 |
fullName isNil ifTrue:[ |
83 | 256 |
^ 'UnresolvedClass(** nil **)' |
52 | 257 |
]. |
360 | 258 |
^ 'UnresolvedClass(' , (fullName copyReplaceAll:$/ with:$.) , ')' |
259 |
||
260 |
"Modified: / 18.7.1998 / 22:57:36 / cg" |
|
41 | 261 |
! ! |
262 |
||
399 | 263 |
!JavaUnresolvedClassConstant methodsFor:'queries'! |
264 |
||
625 | 265 |
isJavaClassRef |
266 |
^ true |
|
267 |
||
268 |
"Created: / 9.11.1999 / 17:07:15 / cg" |
|
269 |
! |
|
270 |
||
399 | 271 |
isUnresolvedClass |
272 |
^ true |
|
273 |
||
274 |
"Created: / 20.10.1998 / 17:43:36 / cg" |
|
443 | 275 |
! |
276 |
||
277 |
package |
|
278 |
"extract from the fullName" |
|
279 |
||
280 |
|components| |
|
281 |
||
282 |
components := fullName asCollectionOfSubstringsSeparatedBy:$/. |
|
283 |
components size > 1 ifTrue:[ |
|
2552
f4c15588965e
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
2396
diff
changeset
|
284 |
^ (components copyButLast:1) asStringWith:$/ |
443 | 285 |
]. |
286 |
^ fullName |
|
287 |
||
288 |
"Created: / 12.11.1998 / 21:11:30 / cg" |
|
399 | 289 |
! ! |
290 |
||
1 | 291 |
!JavaUnresolvedClassConstant methodsFor:'resolving'! |
292 |
||
90 | 293 |
preResolve |
2151 | 294 |
|clsName cls nm ref| |
90 | 295 |
|
296 |
fullName isNil ifTrue:[ |
|
297 |
"/ first, resolve my name ... |
|
298 |
||
299 |
clsName := constantPool at:nameIndex. |
|
300 |
"/ DEBUGGING |
|
301 |
clsName isString ifFalse:[ |
|
302 |
self halt:'oops - no class name string in const pool'. |
|
303 |
]. |
|
304 |
fullName := clsName |
|
305 |
]. |
|
306 |
||
307 |
"/ try to resolve the class |
|
308 |
||
2151 | 309 |
(fullName size == 1) ifTrue:[ |
310 |
"/ good - this is a primitive |
|
311 |
ref := JavaBuiltInClassPointerRef class:(JavaDescriptor fromString: fullName) javaClass nameandType:fullName. |
|
2108 | 312 |
constantPool at:constantPoolIndex put:ref. |
313 |
^ ref |
|
2151 | 314 |
]. |
315 |
||
316 |
(fullName includes:$[) ifFalse:[ |
|
317 |
cls := Java classNamed:fullName. |
|
318 |
cls notNil ifTrue:[ |
|
319 |
"/ good - the class is already loaded. |
|
320 |
constantPool at:constantPoolIndex put:cls. |
|
321 |
^ cls |
|
2108 | 322 |
]. |
2151 | 323 |
] ifTrue:[ |
324 |
" |
|
325 |
Deal with Sun's malformed class refs generated by |
|
326 |
sun.misc.ProxyGenerator - it generates |
|
327 |
java/lang/annotation/ElementType[] instead of |
|
328 |
[Ljava/lang/annotation/ElementType[]; |
|
329 |
as the spec requires!! |
|
330 |
" |
|
331 |
(fullName last == $] and:[(fullName at: fullName size - 1) == $[]) ifTrue: |
|
332 |
[fullName := '[L', (fullName copyTo: fullName size - 2) , ';']. |
|
333 |
||
334 |
(fullName includes: $L) ifFalse:[ |
|
335 |
"/ good - this is a primitive array |
|
336 |
ref := JavaBuiltInClassPointerRef class:(JavaDescriptor fromString: fullName) javaClass nameandType:fullName. |
|
107 | 337 |
constantPool at:constantPoolIndex put:ref. |
338 |
^ ref |
|
339 |
]. |
|
565 | 340 |
]. |
341 |
||
342 |
||
2151 | 343 |
(fullName startsWith:$[) ifFalse:[ |
90 | 344 |
nm := self className. |
2151 | 345 |
self rememberForResolveWith:nm. |
50 | 346 |
]. |
90 | 347 |
^ self |
348 |
||
2151 | 349 |
"Created: / 15-04-1996 / 15:51:42 / cg" |
350 |
"Modified: / 06-07-1999 / 23:41:04 / cg" |
|
351 |
"Modified: / 11-02-2011 / 10:41:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
90 | 352 |
! ! |
353 |
||
135 | 354 |
!JavaUnresolvedClassConstant class methodsFor:'documentation'! |
1 | 355 |
|
356 |
version |
|
3412
df11bb428463
Merged with mercurial revision 4f3cc813be4 (8 changesets total)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3360
diff
changeset
|
357 |
^ '$Header: /cvs/stx/stx/libjava/JavaUnresolvedClassConstant.st,v 1.51 2015-03-20 12:08:00 vrany Exp $' |
2208 | 358 |
! |
359 |
||
360 |
version_CVS |
|
3412
df11bb428463
Merged with mercurial revision 4f3cc813be4 (8 changesets total)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3360
diff
changeset
|
361 |
^ '$Header: /cvs/stx/stx/libjava/JavaUnresolvedClassConstant.st,v 1.51 2015-03-20 12:08:00 vrany Exp $' |
2151 | 362 |
! |
363 |
||
364 |
version_SVN |
|
2731
13f5be2bf83b
Merged d87e89dd5276 and fe83a843a7bf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
365 |
^ 'Id' |
2108 | 366 |
! ! |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2208
diff
changeset
|
367 |