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 |
JavaUnresolvedRefConstant subclass:#JavaUnresolvedFieldrefConstant
|
90
|
18 |
instanceVariableNames:'classIndex'
|
1
|
19 |
classVariableNames:''
|
|
20 |
poolDictionaries:''
|
713
|
21 |
category:'Languages-Java-Reader-Support'
|
1
|
22 |
!
|
|
23 |
|
454
|
24 |
!JavaUnresolvedFieldrefConstant 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 |
!JavaUnresolvedFieldrefConstant class methodsFor:'instance creation'!
|
90
|
43 |
|
|
44 |
pool:aPool poolIndex:idx classIndex:cIdx nameandTypeIndex:nmIdx
|
|
45 |
^ self new
|
|
46 |
pool:aPool poolIndex:idx classIndex:cIdx nameandTypeIndex:nmIdx
|
|
47 |
|
|
48 |
|
|
49 |
! !
|
|
50 |
|
|
51 |
!JavaUnresolvedFieldrefConstant methodsFor:'accessing'!
|
|
52 |
|
163
|
53 |
name
|
|
54 |
|ref cls nameAndType|
|
|
55 |
|
|
56 |
self isUnresolved ifTrue:[
|
|
57 |
ref := self preResolve.
|
|
58 |
ref isUnresolved ifFalse:[
|
|
59 |
^ ref name
|
|
60 |
].
|
|
61 |
nameAndType := (constantPool at:nameandTypeIndex).
|
|
62 |
nameAndType isUnresolved ifTrue:[
|
|
63 |
nameAndType displayString printCR.
|
|
64 |
].
|
|
65 |
^ nameAndType name
|
|
66 |
].
|
|
67 |
('unresolved type: ' , self displayString) printCR.
|
|
68 |
^ self
|
|
69 |
|
|
70 |
"Modified: 24.3.1997 / 13:02:56 / cg"
|
|
71 |
"Created: 24.3.1997 / 13:09:26 / cg"
|
|
72 |
!
|
|
73 |
|
90
|
74 |
pool:aPool poolIndex:slotIndex classIndex:cIdx nameandTypeIndex:nmIdx
|
|
75 |
constantPool := aPool.
|
|
76 |
constantPoolIndex := slotIndex.
|
|
77 |
classIndex := cIdx.
|
|
78 |
nameandTypeIndex := nmIdx
|
|
79 |
|
|
80 |
|
|
81 |
|
163
|
82 |
!
|
|
83 |
|
|
84 |
type
|
|
85 |
|ref cls nameAndType|
|
|
86 |
|
|
87 |
self isUnresolved ifTrue:[
|
|
88 |
ref := self preResolve.
|
|
89 |
ref isUnresolved ifFalse:[
|
|
90 |
^ ref type
|
|
91 |
].
|
|
92 |
nameAndType := (constantPool at:nameandTypeIndex).
|
|
93 |
nameAndType isUnresolved ifTrue:[
|
|
94 |
nameAndType displayString printCR.
|
|
95 |
].
|
255
|
96 |
^ JavaMethod typeFromSignature:nameAndType signature in:nil.
|
163
|
97 |
].
|
|
98 |
('unresolved type: ' , self displayString) printCR.
|
|
99 |
^ self
|
|
100 |
|
255
|
101 |
"Modified: / 8.1.1998 / 19:14:05 / cg"
|
90
|
102 |
! !
|
|
103 |
|
600
|
104 |
!JavaUnresolvedFieldrefConstant methodsFor:'printing & storing'!
|
|
105 |
|
|
106 |
displayString
|
|
107 |
|classOrClassRef className nameAndType fieldName|
|
|
108 |
|
|
109 |
classOrClassRef := (constantPool at:classIndex).
|
|
110 |
className := classOrClassRef fullName.
|
|
111 |
|
|
112 |
nameAndType := (constantPool at:nameandTypeIndex).
|
|
113 |
nameAndType isUnresolved ifTrue:[
|
|
114 |
nameAndType := nameAndType preResolve.
|
|
115 |
].
|
|
116 |
fieldName := nameAndType name.
|
|
117 |
^ (self class name) , '( idx= ' , constantPoolIndex printString , ' class= ' , className , ' field= ' , fieldName ,')'
|
|
118 |
|
|
119 |
|
|
120 |
! !
|
|
121 |
|
1
|
122 |
!JavaUnresolvedFieldrefConstant methodsFor:'resolving'!
|
|
123 |
|
90
|
124 |
preResolve
|
|
125 |
|className class nameAndType ref|
|
|
126 |
|
|
127 |
class := (constantPool at:classIndex).
|
|
128 |
class isUnresolved ifTrue:[
|
|
129 |
class := class preResolve.
|
|
130 |
].
|
|
131 |
class isUnresolved ifFalse:[
|
|
132 |
nameAndType := (constantPool at:nameandTypeIndex).
|
|
133 |
nameAndType isUnresolved ifTrue:[
|
|
134 |
nameAndType := nameAndType preResolve.
|
|
135 |
].
|
|
136 |
nameAndType isUnresolved ifFalse:[
|
|
137 |
"/ good - class is there
|
|
138 |
|
|
139 |
ref := JavaFieldref class:class nameandType:nameAndType.
|
|
140 |
constantPool at:constantPoolIndex put:ref.
|
|
141 |
^ ref
|
|
142 |
]
|
|
143 |
].
|
|
144 |
|
|
145 |
self rememberForResolveWith:(class fullName).
|
|
146 |
^ self
|
|
147 |
|
|
148 |
"Created: 15.4.1996 / 16:05:50 / cg"
|
|
149 |
"Modified: 15.4.1996 / 16:26:44 / cg"
|
600
|
150 |
!
|
|
151 |
|
|
152 |
resolveStatic
|
|
153 |
self halt.
|
|
154 |
^ self
|
|
155 |
|
90
|
156 |
! !
|
|
157 |
|
135
|
158 |
!JavaUnresolvedFieldrefConstant class methodsFor:'documentation'!
|
1
|
159 |
|
|
160 |
version
|
2108
|
161 |
^ '$Header: /cvs/stx/stx/libjava/Attic/JavaUnresolvedFieldrefConstant.st,v 1.13 2002-11-22 20:11:42 cg Exp $'
|
1
|
162 |
! !
|