author | Stefan Vogel <sv@exept.de> |
Thu, 11 Apr 2019 18:36:26 +0200 | |
branch | cvs_MAIN |
changeset 3898 | d8c5eadc3a52 |
parent 3412 | df11bb428463 |
permissions | -rw-r--r-- |
454 | 1 |
" |
3324
a58245c0e83a
Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
2 |
COPYRIGHT (c) 1996-2015 by Claus Gittinger |
454 | 3 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2212
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:
2212
diff
changeset
|
5 |
|
3324
a58245c0e83a
Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
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:
2212
diff
changeset
|
7 |
SWING Research Group, Czech Technical University in Prague |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2212
diff
changeset
|
8 |
|
454 | 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. |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2212
diff
changeset
|
15 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2212
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:
2212
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:
2212
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:
2212
diff
changeset
|
19 |
as of 1.9.2010 |
2151 | 20 |
" |
713 | 21 |
"{ Package: 'stx:libjava' }" |
22 |
||
1 | 23 |
Object subclass:#JavaUnresolvedConstant |
90 | 24 |
instanceVariableNames:'nextUnresolved prevUnresolved constantPool constantPoolIndex' |
25 |
classVariableNames:'PatchLists' |
|
1 | 26 |
poolDictionaries:'' |
713 | 27 |
category:'Languages-Java-Reader-Support' |
1 | 28 |
! |
29 |
||
454 | 30 |
!JavaUnresolvedConstant class methodsFor:'documentation'! |
31 |
||
32 |
copyright |
|
33 |
" |
|
3324
a58245c0e83a
Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
34 |
COPYRIGHT (c) 1996-2015 by Claus Gittinger |
454 | 35 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2212
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:
2212
diff
changeset
|
37 |
|
3324
a58245c0e83a
Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
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:
2212
diff
changeset
|
39 |
SWING Research Group, Czech Technical University in Prague |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2212
diff
changeset
|
40 |
|
454 | 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:
2212
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:
2212
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:
2212
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:
2212
diff
changeset
|
51 |
as of 1.9.2010 |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2212
diff
changeset
|
52 |
|
2151 | 53 |
" |
454 | 54 |
! ! |
1 | 55 |
|
135 | 56 |
!JavaUnresolvedConstant class methodsFor:'instance creation'! |
1 | 57 |
|
90 | 58 |
pool:aPool poolIndex:index |
59 |
^ self new |
|
60 |
pool:aPool poolIndex:index |
|
1 | 61 |
|
62 |
||
63 |
! ! |
|
64 |
||
135 | 65 |
!JavaUnresolvedConstant class methodsFor:'queries'! |
90 | 66 |
|
67 |
countUnresolved |
|
68 |
|u cnt| |
|
69 |
||
70 |
cnt := 0. |
|
71 |
PatchLists do:[:patchList | |
|
72 |
u := patchList. |
|
73 |
[u notNil] whileTrue:[ |
|
74 |
cnt := cnt + 1. |
|
75 |
u := u nextUnresolved |
|
76 |
] |
|
77 |
]. |
|
78 |
^ cnt |
|
79 |
||
80 |
" |
|
81 |
self countUnresolved |
|
82 |
" |
|
83 |
! ! |
|
84 |
||
135 | 85 |
!JavaUnresolvedConstant class methodsFor:'resolving'! |
1 | 86 |
|
90 | 87 |
flushPatchLists |
88 |
PatchLists := nil |
|
93 | 89 |
! |
90 | 90 |
|
399 | 91 |
patchLists |
92 |
"return a collection of patchInfos for unresolved names" |
|
93 |
||
94 |
^ PatchLists ? #() |
|
95 |
||
96 |
"Created: / 20.10.1998 / 17:40:19 / cg" |
|
97 |
! |
|
98 |
||
90 | 99 |
resolveFor:aJavaClass |
100 |
"a JAVA class has been loaded - resolve what can be" |
|
101 |
||
102 |
|patchList unresolved nameSymbol| |
|
103 |
||
104 |
"/ 'resolving: ' print. aJavaClass fullName printCR. |
|
105 |
||
106 |
PatchLists isNil ifTrue:[^ self]. |
|
107 |
||
108 |
nameSymbol := aJavaClass fullName asSymbol. |
|
109 |
patchList := PatchLists at:nameSymbol ifAbsent:nil. |
|
110 |
patchList notNil ifTrue:[ |
|
111 |
PatchLists removeKey:nameSymbol. |
|
112 |
||
113 |
[patchList notNil] whileTrue:[ |
|
114 |
unresolved := patchList. |
|
115 |
patchList := unresolved nextUnresolved. |
|
116 |
||
117 |
unresolved prevUnresolved:nil. |
|
118 |
unresolved nextUnresolved:nil. |
|
119 |
unresolved preResolve. |
|
120 |
] |
|
121 |
]. |
|
122 |
||
123 |
! |
|
124 |
||
125 |
unresolvedClassNames |
|
126 |
"return a collection of unresolved class names" |
|
127 |
||
230 | 128 |
|l| |
129 |
||
90 | 130 |
PatchLists isNil ifTrue:[^ #()]. |
230 | 131 |
|
132 |
"/ kludge - ignore those primitive classes ... |
|
133 |
l := PatchLists keys |
|
134 |
select:[:clsName | |
|
135 |
(clsName == #char |
|
136 |
or:[clsName == #float |
|
137 |
or:[clsName == #double |
|
138 |
or:[clsName == #'unsigned short' |
|
139 |
or:[clsName == #long |
|
140 |
or:[clsName == #boolean]]]]]) not |
|
141 |
]. |
|
142 |
^ l |
|
90 | 143 |
|
144 |
" |
|
145 |
self unresolvedClassNames |
|
146 |
" |
|
230 | 147 |
|
148 |
"Modified: 17.8.1997 / 20:06:46 / cg" |
|
90 | 149 |
! ! |
150 |
||
1 | 151 |
!JavaUnresolvedConstant methodsFor:'accessing'! |
152 |
||
90 | 153 |
constantPool |
154 |
^ constantPool |
|
155 |
||
156 |
"Created: 15.4.1996 / 15:59:45 / cg" |
|
157 |
! |
|
158 |
||
168 | 159 |
constantPool:aPool |
160 |
constantPool := aPool |
|
161 |
||
162 |
"Created: 7.4.1997 / 16:13:02 / cg" |
|
163 |
! |
|
164 |
||
90 | 165 |
constantPoolIndex |
166 |
^ constantPoolIndex |
|
1 | 167 |
|
168 |
"Created: 15.4.1996 / 15:59:45 / cg" |
|
90 | 169 |
! |
170 |
||
171 |
nextUnresolved |
|
172 |
^ nextUnresolved |
|
173 |
! |
|
174 |
||
175 |
nextUnresolved:anUnresolvedConstant |
|
176 |
nextUnresolved := anUnresolvedConstant |
|
177 |
! |
|
178 |
||
179 |
pool:aPool poolIndex:i |
|
180 |
constantPool := aPool. |
|
181 |
constantPoolIndex := i |
|
182 |
||
183 |
"Created: 15.4.1996 / 15:59:45 / cg" |
|
184 |
! |
|
185 |
||
186 |
prevUnresolved:anUnresolvedConstant |
|
187 |
prevUnresolved := anUnresolvedConstant |
|
1 | 188 |
! ! |
189 |
||
83 | 190 |
!JavaUnresolvedConstant methodsFor:'printing & storing'! |
191 |
||
192 |
displayString |
|
90 | 193 |
^ (self class name) , '( idx= ' , constantPoolIndex printString , ')' |
194 |
||
195 |
||
196 |
! ! |
|
197 |
||
198 |
!JavaUnresolvedConstant methodsFor:'queries'! |
|
199 |
||
628 | 200 |
isJavaMethodRef |
201 |
^ false |
|
202 |
||
203 |
"Created: / 14.11.1999 / 15:51:33 / cg" |
|
204 |
! |
|
205 |
||
90 | 206 |
isUnresolved |
207 |
^ true |
|
399 | 208 |
! |
209 |
||
210 |
isUnresolvedClass |
|
211 |
^ false |
|
212 |
||
213 |
"Created: / 20.10.1998 / 17:43:27 / cg" |
|
214 |
! |
|
215 |
||
216 |
isUnresolvedMethod |
|
217 |
^ false |
|
218 |
||
219 |
"Created: / 20.10.1998 / 17:43:07 / cg" |
|
90 | 220 |
! ! |
221 |
||
222 |
!JavaUnresolvedConstant methodsFor:'resolving'! |
|
223 |
||
224 |
preResolve |
|
225 |
self subclassResponsibility. |
|
226 |
^ self |
|
227 |
||
228 |
||
229 |
! |
|
83 | 230 |
|
90 | 231 |
rememberForResolveWith:aFullClassName |
232 |
|patchList nameSymbol| |
|
233 |
||
234 |
prevUnresolved notNil ifTrue:[^ self]. |
|
235 |
||
236 |
PatchLists isNil ifTrue:[ |
|
237 |
PatchLists := IdentityDictionary new. |
|
238 |
]. |
|
239 |
||
240 |
nameSymbol := aFullClassName asSymbol. |
|
241 |
patchList := PatchLists at:nameSymbol ifAbsent:nil. |
|
242 |
patchList isNil ifTrue:[ |
|
243 |
"/ ('first patch for: ' , aFullClassName) printCR. |
|
244 |
] ifFalse:[ |
|
245 |
patchList prevUnresolved:self. |
|
246 |
nextUnresolved := patchList. |
|
247 |
]. |
|
248 |
PatchLists at:nameSymbol put:self. |
|
249 |
prevUnresolved := #startOfList. |
|
83 | 250 |
|
251 |
! ! |
|
252 |
||
206 | 253 |
!JavaUnresolvedConstant methodsFor:'special'! |
254 |
||
255 |
updateClassRefsFrom:oldClass to:newClass |
|
256 |
||
257 |
"Created: 7.8.1997 / 18:21:19 / cg" |
|
258 |
! ! |
|
259 |
||
135 | 260 |
!JavaUnresolvedConstant class methodsFor:'documentation'! |
1 | 261 |
|
262 |
version |
|
3412
df11bb428463
Merged with mercurial revision 4f3cc813be4 (8 changesets total)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3360
diff
changeset
|
263 |
^ '$Header: /cvs/stx/stx/libjava/JavaUnresolvedConstant.st,v 1.19 2015-03-20 12:08:00 vrany Exp $' |
2212 | 264 |
! |
265 |
||
266 |
version_CVS |
|
3412
df11bb428463
Merged with mercurial revision 4f3cc813be4 (8 changesets total)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3360
diff
changeset
|
267 |
^ '$Header: /cvs/stx/stx/libjava/JavaUnresolvedConstant.st,v 1.19 2015-03-20 12:08:00 vrany Exp $' |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2212
diff
changeset
|
268 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2212
diff
changeset
|
269 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2212
diff
changeset
|
270 |
version_HG |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2212
diff
changeset
|
271 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2212
diff
changeset
|
272 |
^ '$Changeset: <not expanded> $' |
2151 | 273 |
! |
274 |
||
275 |
version_SVN |
|
2731
13f5be2bf83b
Merged d87e89dd5276 and fe83a843a7bf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
276 |
^ 'Id' |
2108 | 277 |
! ! |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2212
diff
changeset
|
278 |