author | jv |
Thu, 23 Sep 2010 13:52:13 +0000 | |
changeset 748 | da0840b7798c |
parent 713 | 75e92ac63bf1 |
child 749 | e898eaeff091 |
permissions | -rw-r--r-- |
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 |
||
713 | 15 |
"{ Package: 'stx:libjava' }" |
16 |
||
1 | 17 |
Object subclass:#JavaUnresolvedConstant |
90 | 18 |
instanceVariableNames:'nextUnresolved prevUnresolved constantPool constantPoolIndex' |
19 |
classVariableNames:'PatchLists' |
|
1 | 20 |
poolDictionaries:'' |
713 | 21 |
category:'Languages-Java-Reader-Support' |
1 | 22 |
! |
23 |
||
454 | 24 |
!JavaUnresolvedConstant class methodsFor:'documentation'! |
25 |
||
26 |
copyright |
|
27 |
" |
|
28 |
COPYRIGHT (c) 1997 by eXept Software AG |
|
29 |
All Rights Reserved |
|
30 |
||
31 |
This software is furnished under a license and may be used |
|
32 |
only in accordance with the terms of that license and with the |
|
33 |
inclusion of the above copyright notice. This software may not |
|
34 |
be provided or otherwise made available to, or used by, any |
|
35 |
other person. No title to or ownership of the software is |
|
36 |
hereby transferred. |
|
37 |
" |
|
38 |
||
39 |
||
40 |
! ! |
|
1 | 41 |
|
135 | 42 |
!JavaUnresolvedConstant class methodsFor:'instance creation'! |
1 | 43 |
|
90 | 44 |
pool:aPool poolIndex:index |
45 |
^ self new |
|
46 |
pool:aPool poolIndex:index |
|
1 | 47 |
|
48 |
||
49 |
! ! |
|
50 |
||
135 | 51 |
!JavaUnresolvedConstant class methodsFor:'queries'! |
90 | 52 |
|
53 |
countUnresolved |
|
54 |
|u cnt| |
|
55 |
||
56 |
cnt := 0. |
|
57 |
PatchLists do:[:patchList | |
|
58 |
u := patchList. |
|
59 |
[u notNil] whileTrue:[ |
|
60 |
cnt := cnt + 1. |
|
61 |
u := u nextUnresolved |
|
62 |
] |
|
63 |
]. |
|
64 |
^ cnt |
|
65 |
||
66 |
" |
|
67 |
self countUnresolved |
|
68 |
" |
|
69 |
! ! |
|
70 |
||
135 | 71 |
!JavaUnresolvedConstant class methodsFor:'resolving'! |
1 | 72 |
|
90 | 73 |
flushPatchLists |
74 |
PatchLists := nil |
|
93 | 75 |
! |
90 | 76 |
|
399 | 77 |
patchLists |
78 |
"return a collection of patchInfos for unresolved names" |
|
79 |
||
80 |
^ PatchLists ? #() |
|
81 |
||
82 |
"Created: / 20.10.1998 / 17:40:19 / cg" |
|
83 |
! |
|
84 |
||
90 | 85 |
resolveFor:aJavaClass |
86 |
"a JAVA class has been loaded - resolve what can be" |
|
87 |
||
88 |
|patchList unresolved nameSymbol| |
|
89 |
||
90 |
"/ 'resolving: ' print. aJavaClass fullName printCR. |
|
91 |
||
92 |
PatchLists isNil ifTrue:[^ self]. |
|
93 |
||
94 |
nameSymbol := aJavaClass fullName asSymbol. |
|
95 |
patchList := PatchLists at:nameSymbol ifAbsent:nil. |
|
96 |
patchList notNil ifTrue:[ |
|
97 |
PatchLists removeKey:nameSymbol. |
|
98 |
||
99 |
[patchList notNil] whileTrue:[ |
|
100 |
unresolved := patchList. |
|
101 |
patchList := unresolved nextUnresolved. |
|
102 |
||
103 |
unresolved prevUnresolved:nil. |
|
104 |
unresolved nextUnresolved:nil. |
|
105 |
unresolved preResolve. |
|
106 |
] |
|
107 |
]. |
|
108 |
||
109 |
! |
|
110 |
||
111 |
unresolvedClassNames |
|
112 |
"return a collection of unresolved class names" |
|
113 |
||
230 | 114 |
|l| |
115 |
||
90 | 116 |
PatchLists isNil ifTrue:[^ #()]. |
230 | 117 |
|
118 |
"/ kludge - ignore those primitive classes ... |
|
119 |
l := PatchLists keys |
|
120 |
select:[:clsName | |
|
121 |
(clsName == #char |
|
122 |
or:[clsName == #float |
|
123 |
or:[clsName == #double |
|
124 |
or:[clsName == #'unsigned short' |
|
125 |
or:[clsName == #long |
|
126 |
or:[clsName == #boolean]]]]]) not |
|
127 |
]. |
|
128 |
^ l |
|
90 | 129 |
|
130 |
" |
|
131 |
self unresolvedClassNames |
|
132 |
" |
|
230 | 133 |
|
134 |
"Modified: 17.8.1997 / 20:06:46 / cg" |
|
90 | 135 |
! ! |
136 |
||
1 | 137 |
!JavaUnresolvedConstant methodsFor:'accessing'! |
138 |
||
90 | 139 |
constantPool |
140 |
^ constantPool |
|
141 |
||
142 |
"Created: 15.4.1996 / 15:59:45 / cg" |
|
143 |
! |
|
144 |
||
168 | 145 |
constantPool:aPool |
146 |
constantPool := aPool |
|
147 |
||
148 |
"Created: 7.4.1997 / 16:13:02 / cg" |
|
149 |
! |
|
150 |
||
90 | 151 |
constantPoolIndex |
152 |
^ constantPoolIndex |
|
1 | 153 |
|
154 |
"Created: 15.4.1996 / 15:59:45 / cg" |
|
90 | 155 |
! |
156 |
||
157 |
nextUnresolved |
|
158 |
^ nextUnresolved |
|
159 |
! |
|
160 |
||
161 |
nextUnresolved:anUnresolvedConstant |
|
162 |
nextUnresolved := anUnresolvedConstant |
|
163 |
! |
|
164 |
||
165 |
pool:aPool poolIndex:i |
|
166 |
constantPool := aPool. |
|
167 |
constantPoolIndex := i |
|
168 |
||
169 |
"Created: 15.4.1996 / 15:59:45 / cg" |
|
170 |
! |
|
171 |
||
172 |
prevUnresolved:anUnresolvedConstant |
|
173 |
prevUnresolved := anUnresolvedConstant |
|
1 | 174 |
! ! |
175 |
||
83 | 176 |
!JavaUnresolvedConstant methodsFor:'printing & storing'! |
177 |
||
178 |
displayString |
|
90 | 179 |
^ (self class name) , '( idx= ' , constantPoolIndex printString , ')' |
180 |
||
181 |
||
182 |
! ! |
|
183 |
||
184 |
!JavaUnresolvedConstant methodsFor:'queries'! |
|
185 |
||
628 | 186 |
isJavaMethodRef |
187 |
^ false |
|
188 |
||
189 |
"Created: / 14.11.1999 / 15:51:33 / cg" |
|
190 |
! |
|
191 |
||
90 | 192 |
isUnresolved |
193 |
^ true |
|
399 | 194 |
! |
195 |
||
196 |
isUnresolvedClass |
|
197 |
^ false |
|
198 |
||
199 |
"Created: / 20.10.1998 / 17:43:27 / cg" |
|
200 |
! |
|
201 |
||
202 |
isUnresolvedMethod |
|
203 |
^ false |
|
204 |
||
205 |
"Created: / 20.10.1998 / 17:43:07 / cg" |
|
90 | 206 |
! ! |
207 |
||
208 |
!JavaUnresolvedConstant methodsFor:'resolving'! |
|
209 |
||
210 |
preResolve |
|
211 |
self subclassResponsibility. |
|
212 |
^ self |
|
213 |
||
214 |
||
215 |
! |
|
83 | 216 |
|
90 | 217 |
rememberForResolveWith:aFullClassName |
218 |
|patchList nameSymbol| |
|
219 |
||
220 |
prevUnresolved notNil ifTrue:[^ self]. |
|
221 |
||
222 |
PatchLists isNil ifTrue:[ |
|
223 |
PatchLists := IdentityDictionary new. |
|
224 |
]. |
|
225 |
||
226 |
nameSymbol := aFullClassName asSymbol. |
|
227 |
patchList := PatchLists at:nameSymbol ifAbsent:nil. |
|
228 |
patchList isNil ifTrue:[ |
|
229 |
"/ ('first patch for: ' , aFullClassName) printCR. |
|
230 |
] ifFalse:[ |
|
231 |
patchList prevUnresolved:self. |
|
232 |
nextUnresolved := patchList. |
|
233 |
]. |
|
234 |
PatchLists at:nameSymbol put:self. |
|
235 |
prevUnresolved := #startOfList. |
|
83 | 236 |
|
237 |
! ! |
|
238 |
||
206 | 239 |
!JavaUnresolvedConstant methodsFor:'special'! |
240 |
||
241 |
updateClassRefsFrom:oldClass to:newClass |
|
242 |
||
243 |
"Created: 7.8.1997 / 18:21:19 / cg" |
|
244 |
! ! |
|
245 |
||
135 | 246 |
!JavaUnresolvedConstant class methodsFor:'documentation'! |
1 | 247 |
|
248 |
version |
|
748
da0840b7798c
Manufactured by SVN::ImportFromCVSTask to fix repository layout
jv
parents:
713
diff
changeset
|
249 |
^ '$Id$' |
1 | 250 |
! ! |