author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Sun, 18 Aug 2013 22:10:26 +0100 | |
branch | development |
changeset 2663 | 9a0a73601e90 |
parent 2429 | ebece4dcaab9 |
child 2711 | a00302fe5083 |
permissions | -rw-r--r-- |
454 | 1 |
" |
2151 | 2 |
COPYRIGHT (c) 1996-2011 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 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2212
diff
changeset
|
6 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
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 |
" |
|
2151 | 34 |
COPYRIGHT (c) 1996-2011 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 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2212
diff
changeset
|
38 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
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 |
|
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
56 |
|
135 | 57 |
!JavaUnresolvedConstant class methodsFor:'instance creation'! |
1 | 58 |
|
90 | 59 |
pool:aPool poolIndex:index |
60 |
^ self new |
|
61 |
pool:aPool poolIndex:index |
|
1 | 62 |
|
63 |
||
64 |
! ! |
|
65 |
||
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
66 |
|
135 | 67 |
!JavaUnresolvedConstant class methodsFor:'queries'! |
90 | 68 |
|
69 |
countUnresolved |
|
70 |
|u cnt| |
|
71 |
||
72 |
cnt := 0. |
|
73 |
PatchLists do:[:patchList | |
|
74 |
u := patchList. |
|
75 |
[u notNil] whileTrue:[ |
|
76 |
cnt := cnt + 1. |
|
77 |
u := u nextUnresolved |
|
78 |
] |
|
79 |
]. |
|
80 |
^ cnt |
|
81 |
||
82 |
" |
|
83 |
self countUnresolved |
|
84 |
" |
|
85 |
! ! |
|
86 |
||
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
87 |
|
135 | 88 |
!JavaUnresolvedConstant class methodsFor:'resolving'! |
1 | 89 |
|
90 | 90 |
flushPatchLists |
91 |
PatchLists := nil |
|
93 | 92 |
! |
90 | 93 |
|
399 | 94 |
patchLists |
95 |
"return a collection of patchInfos for unresolved names" |
|
96 |
||
97 |
^ PatchLists ? #() |
|
98 |
||
99 |
"Created: / 20.10.1998 / 17:40:19 / cg" |
|
100 |
! |
|
101 |
||
90 | 102 |
resolveFor:aJavaClass |
103 |
"a JAVA class has been loaded - resolve what can be" |
|
104 |
||
105 |
|patchList unresolved nameSymbol| |
|
106 |
||
107 |
"/ 'resolving: ' print. aJavaClass fullName printCR. |
|
108 |
||
109 |
PatchLists isNil ifTrue:[^ self]. |
|
110 |
||
111 |
nameSymbol := aJavaClass fullName asSymbol. |
|
112 |
patchList := PatchLists at:nameSymbol ifAbsent:nil. |
|
113 |
patchList notNil ifTrue:[ |
|
114 |
PatchLists removeKey:nameSymbol. |
|
115 |
||
116 |
[patchList notNil] whileTrue:[ |
|
117 |
unresolved := patchList. |
|
118 |
patchList := unresolved nextUnresolved. |
|
119 |
||
120 |
unresolved prevUnresolved:nil. |
|
121 |
unresolved nextUnresolved:nil. |
|
122 |
unresolved preResolve. |
|
123 |
] |
|
124 |
]. |
|
125 |
||
126 |
! |
|
127 |
||
128 |
unresolvedClassNames |
|
129 |
"return a collection of unresolved class names" |
|
130 |
||
230 | 131 |
|l| |
132 |
||
90 | 133 |
PatchLists isNil ifTrue:[^ #()]. |
230 | 134 |
|
135 |
"/ kludge - ignore those primitive classes ... |
|
136 |
l := PatchLists keys |
|
137 |
select:[:clsName | |
|
138 |
(clsName == #char |
|
139 |
or:[clsName == #float |
|
140 |
or:[clsName == #double |
|
141 |
or:[clsName == #'unsigned short' |
|
142 |
or:[clsName == #long |
|
143 |
or:[clsName == #boolean]]]]]) not |
|
144 |
]. |
|
145 |
^ l |
|
90 | 146 |
|
147 |
" |
|
148 |
self unresolvedClassNames |
|
149 |
" |
|
230 | 150 |
|
151 |
"Modified: 17.8.1997 / 20:06:46 / cg" |
|
90 | 152 |
! ! |
153 |
||
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
154 |
|
1 | 155 |
!JavaUnresolvedConstant methodsFor:'accessing'! |
156 |
||
90 | 157 |
constantPool |
158 |
^ constantPool |
|
159 |
||
160 |
"Created: 15.4.1996 / 15:59:45 / cg" |
|
161 |
! |
|
162 |
||
168 | 163 |
constantPool:aPool |
164 |
constantPool := aPool |
|
165 |
||
166 |
"Created: 7.4.1997 / 16:13:02 / cg" |
|
167 |
! |
|
168 |
||
90 | 169 |
constantPoolIndex |
170 |
^ constantPoolIndex |
|
1 | 171 |
|
172 |
"Created: 15.4.1996 / 15:59:45 / cg" |
|
90 | 173 |
! |
174 |
||
175 |
nextUnresolved |
|
176 |
^ nextUnresolved |
|
177 |
! |
|
178 |
||
179 |
nextUnresolved:anUnresolvedConstant |
|
180 |
nextUnresolved := anUnresolvedConstant |
|
181 |
! |
|
182 |
||
183 |
pool:aPool poolIndex:i |
|
184 |
constantPool := aPool. |
|
185 |
constantPoolIndex := i |
|
186 |
||
187 |
"Created: 15.4.1996 / 15:59:45 / cg" |
|
188 |
! |
|
189 |
||
190 |
prevUnresolved:anUnresolvedConstant |
|
191 |
prevUnresolved := anUnresolvedConstant |
|
1 | 192 |
! ! |
193 |
||
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
194 |
|
83 | 195 |
!JavaUnresolvedConstant methodsFor:'printing & storing'! |
196 |
||
197 |
displayString |
|
90 | 198 |
^ (self class name) , '( idx= ' , constantPoolIndex printString , ')' |
199 |
||
200 |
||
201 |
! ! |
|
202 |
||
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
203 |
|
90 | 204 |
!JavaUnresolvedConstant methodsFor:'queries'! |
205 |
||
628 | 206 |
isJavaMethodRef |
207 |
^ false |
|
208 |
||
209 |
"Created: / 14.11.1999 / 15:51:33 / cg" |
|
210 |
! |
|
211 |
||
90 | 212 |
isUnresolved |
213 |
^ true |
|
399 | 214 |
! |
215 |
||
216 |
isUnresolvedClass |
|
217 |
^ false |
|
218 |
||
219 |
"Created: / 20.10.1998 / 17:43:27 / cg" |
|
220 |
! |
|
221 |
||
222 |
isUnresolvedMethod |
|
223 |
^ false |
|
224 |
||
225 |
"Created: / 20.10.1998 / 17:43:07 / cg" |
|
90 | 226 |
! ! |
227 |
||
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
228 |
|
90 | 229 |
!JavaUnresolvedConstant methodsFor:'resolving'! |
230 |
||
231 |
preResolve |
|
232 |
self subclassResponsibility. |
|
233 |
^ self |
|
234 |
||
235 |
||
236 |
! |
|
83 | 237 |
|
90 | 238 |
rememberForResolveWith:aFullClassName |
239 |
|patchList nameSymbol| |
|
240 |
||
241 |
prevUnresolved notNil ifTrue:[^ self]. |
|
242 |
||
243 |
PatchLists isNil ifTrue:[ |
|
244 |
PatchLists := IdentityDictionary new. |
|
245 |
]. |
|
246 |
||
247 |
nameSymbol := aFullClassName asSymbol. |
|
248 |
patchList := PatchLists at:nameSymbol ifAbsent:nil. |
|
249 |
patchList isNil ifTrue:[ |
|
250 |
"/ ('first patch for: ' , aFullClassName) printCR. |
|
251 |
] ifFalse:[ |
|
252 |
patchList prevUnresolved:self. |
|
253 |
nextUnresolved := patchList. |
|
254 |
]. |
|
255 |
PatchLists at:nameSymbol put:self. |
|
256 |
prevUnresolved := #startOfList. |
|
83 | 257 |
|
258 |
! ! |
|
259 |
||
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
260 |
|
206 | 261 |
!JavaUnresolvedConstant methodsFor:'special'! |
262 |
||
263 |
updateClassRefsFrom:oldClass to:newClass |
|
264 |
||
265 |
"Created: 7.8.1997 / 18:21:19 / cg" |
|
266 |
! ! |
|
267 |
||
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
268 |
|
135 | 269 |
!JavaUnresolvedConstant class methodsFor:'documentation'! |
1 | 270 |
|
271 |
version |
|
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
272 |
^ '$Header: /cvs/stx/stx/libjava/JavaUnresolvedConstant.st,v 1.16 2013-02-25 11:15:31 vrany Exp $' |
2212 | 273 |
! |
274 |
||
275 |
version_CVS |
|
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
276 |
^ '$Header: /cvs/stx/stx/libjava/JavaUnresolvedConstant.st,v 1.16 2013-02-25 11:15:31 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
|
277 |
! |
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 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2212
diff
changeset
|
279 |
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
|
280 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2212
diff
changeset
|
281 |
^ '$Changeset: <not expanded> $' |
2151 | 282 |
! |
283 |
||
284 |
version_SVN |
|
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
|
285 |
^ '§Id§' |
2108 | 286 |
! ! |
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
|
287 |