author | vranyj1 |
Tue, 26 Jul 2011 16:31:02 +0000 | |
branch | jk_new_structure |
changeset 877 | f5a5b93e1c78 |
parent 806 | 7d1f2ba6d2df |
child 915 | cf0d328465c2 |
permissions | -rw-r--r-- |
877 | 1 |
" |
2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
|
3 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
|
4 |
SWING Research Group, Czech Technical University in Prague |
|
5 |
||
6 |
Parts of the code written by Claus Gittinger are under following |
|
7 |
license: |
|
8 |
||
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. |
|
15 |
||
16 |
Parts of the code written at SWING Reasearch Group [1] are MIT licensed: |
|
17 |
||
18 |
Permission is hereby granted, free of charge, to any person |
|
19 |
obtaining a copy of this software and associated documentation |
|
20 |
files (the 'Software'), to deal in the Software without |
|
21 |
restriction, including without limitation the rights to use, |
|
22 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
23 |
copies of the Software, and to permit persons to whom the |
|
24 |
Software is furnished to do so, subject to the following |
|
25 |
conditions: |
|
26 |
||
27 |
The above copyright notice and this permission notice shall be |
|
28 |
included in all copies or substantial portions of the Software. |
|
29 |
||
30 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
31 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
32 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
33 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
34 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
35 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
36 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
37 |
OTHER DEALINGS IN THE SOFTWARE. |
|
38 |
||
39 |
[1] Code written at SWING Research Group contain a signature |
|
40 |
of one of the above copright owners. |
|
41 |
" |
|
752 | 42 |
"{ Package: 'stx:libjava' }" |
43 |
||
44 |
JavaRef2 subclass:#JavaClassContentRef2 |
|
794
9635f32d1723
implemented deeper caching in new resolving refs to help keeping C-code lean and clean
hlopkmar
parents:
778
diff
changeset
|
45 |
instanceVariableNames:'classRefIndex nameAndTypeIndex classCache nameAndTypeCache' |
752 | 46 |
classVariableNames:'' |
47 |
poolDictionaries:'' |
|
48 |
category:'Languages-Java-Reader-Support-new' |
|
49 |
! |
|
50 |
||
877 | 51 |
!JavaClassContentRef2 class methodsFor:'documentation'! |
52 |
||
53 |
copyright |
|
54 |
" |
|
55 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
|
56 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
|
57 |
SWING Research Group, Czech Technical University in Prague |
|
58 |
||
59 |
Parts of the code written by Claus Gittinger are under following |
|
60 |
license: |
|
61 |
||
62 |
This software is furnished under a license and may be used |
|
63 |
only in accordance with the terms of that license and with the |
|
64 |
inclusion of the above copyright notice. This software may not |
|
65 |
be provided or otherwise made available to, or used by, any |
|
66 |
other person. No title to or ownership of the software is |
|
67 |
hereby transferred. |
|
68 |
||
69 |
Parts of the code written at SWING Reasearch Group [1] are MIT licensed: |
|
70 |
||
71 |
Permission is hereby granted, free of charge, to any person |
|
72 |
obtaining a copy of this software and associated documentation |
|
73 |
files (the 'Software'), to deal in the Software without |
|
74 |
restriction, including without limitation the rights to use, |
|
75 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
76 |
copies of the Software, and to permit persons to whom the |
|
77 |
Software is furnished to do so, subject to the following |
|
78 |
conditions: |
|
79 |
||
80 |
The above copyright notice and this permission notice shall be |
|
81 |
included in all copies or substantial portions of the Software. |
|
82 |
||
83 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
84 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
85 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
86 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
87 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
88 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
89 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
90 |
OTHER DEALINGS IN THE SOFTWARE. |
|
91 |
||
92 |
[1] Code written at SWING Research Group contain a signature |
|
93 |
of one of the above copright owners. |
|
94 |
||
95 |
" |
|
96 |
! ! |
|
752 | 97 |
|
758 | 98 |
!JavaClassContentRef2 class methodsFor:'instance creation'! |
99 |
||
777 | 100 |
in: aJavaConstantPool withNameAndTypeAt: nameAndTypeCPIndex andClassAt: classRefCPIndex |
101 |
^ self basicNew |
|
102 |
initializeIn: aJavaConstantPool |
|
103 |
withNameAndTypeAt: nameAndTypeCPIndex |
|
104 |
andClassAt: classRefCPIndex. |
|
758 | 105 |
|
777 | 106 |
"Created: / 12-05-2011 / 18:36:18 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
758 | 107 |
! ! |
108 |
||
109 |
!JavaClassContentRef2 methodsFor:'accessing'! |
|
110 |
||
111 |
classRef |
|
777 | 112 |
^ constantPool at: classRefIndex. |
113 |
||
114 |
"Modified: / 12-05-2011 / 18:38:58 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
758 | 115 |
! |
116 |
||
117 |
descriptor |
|
777 | 118 |
^ self nameAndType descriptor. |
758 | 119 |
|
120 |
"Created: / 08-04-2011 / 15:08:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
777 | 121 |
"Modified: / 12-05-2011 / 18:39:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
758 | 122 |
! |
123 |
||
124 |
name |
|
777 | 125 |
^ self nameAndType name. |
758 | 126 |
|
127 |
"Created: / 08-04-2011 / 13:54:28 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
777 | 128 |
"Modified: / 12-05-2011 / 18:39:44 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 129 |
! |
130 |
||
131 |
nameAndType |
|
777 | 132 |
^ constantPool at: nameAndTypeIndex. |
761 | 133 |
|
134 |
"Created: / 11-04-2011 / 19:57:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
777 | 135 |
"Modified: / 12-05-2011 / 18:39:27 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 136 |
! |
137 |
||
138 |
selector |
|
777 | 139 |
^ self nameAndType selector. |
761 | 140 |
|
141 |
"Created: / 11-04-2011 / 20:38:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
777 | 142 |
"Modified: / 12-05-2011 / 18:39:33 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
806 | 143 |
! |
144 |
||
145 |
signature |
|
146 |
^ self nameAndType signature. |
|
147 |
||
148 |
"Created: / 20-05-2011 / 17:10:59 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
758 | 149 |
! ! |
150 |
||
752 | 151 |
!JavaClassContentRef2 methodsFor:'comparing'! |
152 |
||
153 |
= anotherJavaRef |
|
154 |
"superclass JavaRef2 says that I am responsible to implement this method" |
|
155 |
||
156 |
^ self shouldImplement |
|
157 |
! |
|
158 |
||
159 |
hash |
|
160 |
"superclass JavaRef2 says that I am responsible to implement this method" |
|
161 |
||
162 |
^ self shouldImplement |
|
163 |
! ! |
|
164 |
||
758 | 165 |
!JavaClassContentRef2 methodsFor:'initialization'! |
166 |
||
777 | 167 |
initializeIn: aJavaConstantPool withNameAndTypeAt: nameAndTypeCPIndex andClassAt: classRefCPIndex |
168 |
constantPool := aJavaConstantPool. |
|
169 |
classRefIndex := classRefCPIndex. |
|
170 |
nameAndTypeIndex := nameAndTypeCPIndex. |
|
758 | 171 |
super initialize. |
172 |
||
777 | 173 |
"Created: / 12-05-2011 / 18:37:10 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
771 | 174 |
! ! |
175 |
||
176 |
!JavaClassContentRef2 methodsFor:'printing'! |
|
177 |
||
178 |
printString |
|
777 | 179 |
^ 'JavaClassContentRef: class=[' , self classRef printString , '] name=[' |
180 |
, self nameAndType printString , ']'. |
|
771 | 181 |
|
182 |
"Created: / 10-05-2011 / 14:15:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
777 | 183 |
"Modified: / 12-05-2011 / 18:40:02 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
758 | 184 |
! ! |
185 |
||
186 |
!JavaClassContentRef2 methodsFor:'resolving'! |
|
187 |
||
761 | 188 |
invalidate |
778
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
189 |
self classRef invalidate. |
794
9635f32d1723
implemented deeper caching in new resolving refs to help keeping C-code lean and clean
hlopkmar
parents:
778
diff
changeset
|
190 |
classCache := nil. |
9635f32d1723
implemented deeper caching in new resolving refs to help keeping C-code lean and clean
hlopkmar
parents:
778
diff
changeset
|
191 |
nameAndTypeCache := nil. |
771 | 192 |
super invalidate. |
761 | 193 |
|
194 |
"Created: / 13-04-2011 / 12:21:38 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
794
9635f32d1723
implemented deeper caching in new resolving refs to help keeping C-code lean and clean
hlopkmar
parents:
778
diff
changeset
|
195 |
"Modified: / 18-05-2011 / 12:41:35 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 196 |
! |
197 |
||
758 | 198 |
invalidateForClass: internalJavaClassName |
199 |
"Invalidate (means call invalidate) reference if it has something to do with given class (e.g Class named internalJavaClassName was unloaded). |
|
200 |
Return true, if reference was invalidated." |
|
201 |
||
777 | 202 |
(self classRef invalidateForClass: internalJavaClassName) |
203 |
ifTrue: |
|
204 |
[ self invalidate. |
|
205 |
^ true ]. |
|
206 |
^ false. |
|
758 | 207 |
|
777 | 208 |
"Modified: / 12-05-2011 / 18:40:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
758 | 209 |
! ! |
210 |
||
752 | 211 |
!JavaClassContentRef2 class methodsFor:'documentation'! |
212 |
||
213 |
version_SVN |
|
214 |
^ '$Id$' |
|
215 |
! ! |