1
|
1 |
Object subclass:#JavaUnresolvedConstant
|
90
|
2 |
instanceVariableNames:'nextUnresolved prevUnresolved constantPool constantPoolIndex'
|
|
3 |
classVariableNames:'PatchLists'
|
1
|
4 |
poolDictionaries:''
|
|
5 |
category:'Java-Reader-Support'
|
|
6 |
!
|
|
7 |
|
|
8 |
|
135
|
9 |
!JavaUnresolvedConstant class methodsFor:'instance creation'!
|
1
|
10 |
|
90
|
11 |
pool:aPool poolIndex:index
|
|
12 |
^ self new
|
|
13 |
pool:aPool poolIndex:index
|
1
|
14 |
|
|
15 |
|
|
16 |
! !
|
|
17 |
|
135
|
18 |
!JavaUnresolvedConstant class methodsFor:'queries'!
|
90
|
19 |
|
|
20 |
countUnresolved
|
|
21 |
|u cnt|
|
|
22 |
|
|
23 |
cnt := 0.
|
|
24 |
PatchLists do:[:patchList |
|
|
25 |
u := patchList.
|
|
26 |
[u notNil] whileTrue:[
|
|
27 |
cnt := cnt + 1.
|
|
28 |
u := u nextUnresolved
|
|
29 |
]
|
|
30 |
].
|
|
31 |
^ cnt
|
|
32 |
|
|
33 |
"
|
|
34 |
self countUnresolved
|
|
35 |
"
|
|
36 |
! !
|
|
37 |
|
135
|
38 |
!JavaUnresolvedConstant class methodsFor:'resolving'!
|
1
|
39 |
|
90
|
40 |
flushPatchLists
|
|
41 |
PatchLists := nil
|
93
|
42 |
!
|
90
|
43 |
|
|
44 |
resolveFor:aJavaClass
|
|
45 |
"a JAVA class has been loaded - resolve what can be"
|
|
46 |
|
|
47 |
|patchList unresolved nameSymbol|
|
|
48 |
|
|
49 |
"/ 'resolving: ' print. aJavaClass fullName printCR.
|
|
50 |
|
|
51 |
PatchLists isNil ifTrue:[^ self].
|
|
52 |
|
|
53 |
nameSymbol := aJavaClass fullName asSymbol.
|
|
54 |
patchList := PatchLists at:nameSymbol ifAbsent:nil.
|
|
55 |
patchList notNil ifTrue:[
|
|
56 |
PatchLists removeKey:nameSymbol.
|
|
57 |
|
|
58 |
[patchList notNil] whileTrue:[
|
|
59 |
unresolved := patchList.
|
|
60 |
patchList := unresolved nextUnresolved.
|
|
61 |
|
|
62 |
unresolved prevUnresolved:nil.
|
|
63 |
unresolved nextUnresolved:nil.
|
|
64 |
unresolved preResolve.
|
|
65 |
]
|
|
66 |
].
|
|
67 |
|
|
68 |
!
|
|
69 |
|
|
70 |
unresolvedClassNames
|
|
71 |
"return a collection of unresolved class names"
|
|
72 |
|
|
73 |
PatchLists isNil ifTrue:[^ #()].
|
|
74 |
^ PatchLists keys
|
|
75 |
|
|
76 |
"
|
|
77 |
self unresolvedClassNames
|
|
78 |
"
|
|
79 |
! !
|
|
80 |
|
1
|
81 |
!JavaUnresolvedConstant methodsFor:'accessing'!
|
|
82 |
|
90
|
83 |
constantPool
|
|
84 |
^ constantPool
|
|
85 |
|
|
86 |
"Created: 15.4.1996 / 15:59:45 / cg"
|
|
87 |
!
|
|
88 |
|
168
|
89 |
constantPool:aPool
|
|
90 |
constantPool := aPool
|
|
91 |
|
|
92 |
"Created: 7.4.1997 / 16:13:02 / cg"
|
|
93 |
!
|
|
94 |
|
90
|
95 |
constantPoolIndex
|
|
96 |
^ constantPoolIndex
|
1
|
97 |
|
|
98 |
"Created: 15.4.1996 / 15:59:45 / cg"
|
90
|
99 |
!
|
|
100 |
|
|
101 |
nextUnresolved
|
|
102 |
^ nextUnresolved
|
|
103 |
!
|
|
104 |
|
|
105 |
nextUnresolved:anUnresolvedConstant
|
|
106 |
nextUnresolved := anUnresolvedConstant
|
|
107 |
!
|
|
108 |
|
|
109 |
pool:aPool poolIndex:i
|
|
110 |
constantPool := aPool.
|
|
111 |
constantPoolIndex := i
|
|
112 |
|
|
113 |
"Created: 15.4.1996 / 15:59:45 / cg"
|
|
114 |
!
|
|
115 |
|
|
116 |
prevUnresolved:anUnresolvedConstant
|
|
117 |
prevUnresolved := anUnresolvedConstant
|
1
|
118 |
! !
|
|
119 |
|
83
|
120 |
!JavaUnresolvedConstant methodsFor:'printing & storing'!
|
|
121 |
|
|
122 |
displayString
|
90
|
123 |
^ (self class name) , '( idx= ' , constantPoolIndex printString , ')'
|
|
124 |
|
|
125 |
|
|
126 |
! !
|
|
127 |
|
|
128 |
!JavaUnresolvedConstant methodsFor:'queries'!
|
|
129 |
|
|
130 |
isUnresolved
|
|
131 |
^ true
|
|
132 |
! !
|
|
133 |
|
|
134 |
!JavaUnresolvedConstant methodsFor:'resolving'!
|
|
135 |
|
|
136 |
preResolve
|
|
137 |
self subclassResponsibility.
|
|
138 |
^ self
|
|
139 |
|
|
140 |
|
|
141 |
!
|
83
|
142 |
|
90
|
143 |
rememberForResolveWith:aFullClassName
|
|
144 |
|patchList nameSymbol|
|
|
145 |
|
|
146 |
prevUnresolved notNil ifTrue:[^ self].
|
|
147 |
|
|
148 |
PatchLists isNil ifTrue:[
|
|
149 |
PatchLists := IdentityDictionary new.
|
|
150 |
].
|
|
151 |
|
|
152 |
nameSymbol := aFullClassName asSymbol.
|
|
153 |
patchList := PatchLists at:nameSymbol ifAbsent:nil.
|
|
154 |
patchList isNil ifTrue:[
|
|
155 |
"/ ('first patch for: ' , aFullClassName) printCR.
|
|
156 |
] ifFalse:[
|
|
157 |
patchList prevUnresolved:self.
|
|
158 |
nextUnresolved := patchList.
|
|
159 |
].
|
|
160 |
PatchLists at:nameSymbol put:self.
|
|
161 |
prevUnresolved := #startOfList.
|
83
|
162 |
|
|
163 |
! !
|
|
164 |
|
135
|
165 |
!JavaUnresolvedConstant class methodsFor:'documentation'!
|
1
|
166 |
|
|
167 |
version
|
168
|
168 |
^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaUnresolvedConstant.st,v 1.6 1997/04/07 17:26:33 cg Exp $'
|
1
|
169 |
! !
|