author | Marcel Hlopko <marcel.hlopko@fit.cvut.cz> |
Tue, 18 Dec 2012 18:42:43 +0100 | |
branch | development |
changeset 1908 | 923de168f3d6 |
parent 1864 | 60a8dc26c8c6 |
child 2069 | 75d40b7b986f |
permissions | -rw-r--r-- |
877 | 1 |
" |
2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
|
1152 | 3 |
|
1155 | 4 |
New code and modifications done at SWING Research Group [1]: |
1152 | 5 |
|
877 | 6 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
7 |
SWING Research Group, Czech Technical University in Prague |
|
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 |
||
1155 | 16 |
[1] Code written at SWING Research Group contains a signature |
17 |
of one of the above copright owners. For exact set of such code, |
|
18 |
see the differences between this version and version stx:libjava |
|
1152 | 19 |
as of 1.9.2010 |
877 | 20 |
" |
752 | 21 |
"{ Package: 'stx:libjava' }" |
22 |
||
23 |
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
|
24 |
instanceVariableNames:'classRefIndex nameAndTypeIndex classCache nameAndTypeCache' |
752 | 25 |
classVariableNames:'' |
26 |
poolDictionaries:'' |
|
27 |
category:'Languages-Java-Reader-Support-new' |
|
28 |
! |
|
29 |
||
877 | 30 |
!JavaClassContentRef2 class methodsFor:'documentation'! |
31 |
||
32 |
copyright |
|
33 |
" |
|
34 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
|
1152 | 35 |
|
1155 | 36 |
New code and modifications done at SWING Research Group [1]: |
1152 | 37 |
|
877 | 38 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
39 |
SWING Research Group, Czech Technical University in Prague |
|
40 |
||
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. |
|
47 |
||
1155 | 48 |
[1] Code written at SWING Research Group contains a signature |
49 |
of one of the above copright owners. For exact set of such code, |
|
50 |
see the differences between this version and version stx:libjava |
|
1152 | 51 |
as of 1.9.2010 |
877 | 52 |
|
53 |
" |
|
54 |
! ! |
|
752 | 55 |
|
758 | 56 |
!JavaClassContentRef2 class methodsFor:'instance creation'! |
57 |
||
777 | 58 |
in: aJavaConstantPool withNameAndTypeAt: nameAndTypeCPIndex andClassAt: classRefCPIndex |
59 |
^ self basicNew |
|
60 |
initializeIn: aJavaConstantPool |
|
61 |
withNameAndTypeAt: nameAndTypeCPIndex |
|
62 |
andClassAt: classRefCPIndex. |
|
758 | 63 |
|
777 | 64 |
"Created: / 12-05-2011 / 18:36:18 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
758 | 65 |
! ! |
66 |
||
67 |
!JavaClassContentRef2 methodsFor:'accessing'! |
|
68 |
||
69 |
classRef |
|
777 | 70 |
^ constantPool at: classRefIndex. |
71 |
||
72 |
"Modified: / 12-05-2011 / 18:38:58 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
758 | 73 |
! |
74 |
||
75 |
descriptor |
|
777 | 76 |
^ self nameAndType descriptor. |
758 | 77 |
|
78 |
"Created: / 08-04-2011 / 15:08:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
777 | 79 |
"Modified: / 12-05-2011 / 18:39:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
758 | 80 |
! |
81 |
||
82 |
name |
|
777 | 83 |
^ self nameAndType name. |
758 | 84 |
|
85 |
"Created: / 08-04-2011 / 13:54:28 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
777 | 86 |
"Modified: / 12-05-2011 / 18:39:44 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 87 |
! |
88 |
||
89 |
nameAndType |
|
777 | 90 |
^ constantPool at: nameAndTypeIndex. |
761 | 91 |
|
92 |
"Created: / 11-04-2011 / 19:57:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
777 | 93 |
"Modified: / 12-05-2011 / 18:39:27 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 94 |
! |
95 |
||
96 |
selector |
|
777 | 97 |
^ self nameAndType selector. |
761 | 98 |
|
99 |
"Created: / 11-04-2011 / 20:38:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
777 | 100 |
"Modified: / 12-05-2011 / 18:39:33 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
806 | 101 |
! |
102 |
||
103 |
signature |
|
104 |
^ self nameAndType signature. |
|
105 |
||
106 |
"Created: / 20-05-2011 / 17:10:59 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
758 | 107 |
! ! |
108 |
||
752 | 109 |
!JavaClassContentRef2 methodsFor:'comparing'! |
110 |
||
111 |
= anotherJavaRef |
|
112 |
"superclass JavaRef2 says that I am responsible to implement this method" |
|
113 |
||
114 |
^ self shouldImplement |
|
115 |
! |
|
116 |
||
117 |
hash |
|
118 |
"superclass JavaRef2 says that I am responsible to implement this method" |
|
119 |
||
120 |
^ self shouldImplement |
|
121 |
! ! |
|
122 |
||
758 | 123 |
!JavaClassContentRef2 methodsFor:'initialization'! |
124 |
||
777 | 125 |
initializeIn: aJavaConstantPool withNameAndTypeAt: nameAndTypeCPIndex andClassAt: classRefCPIndex |
126 |
constantPool := aJavaConstantPool. |
|
127 |
classRefIndex := classRefCPIndex. |
|
128 |
nameAndTypeIndex := nameAndTypeCPIndex. |
|
758 | 129 |
super initialize. |
130 |
||
777 | 131 |
"Created: / 12-05-2011 / 18:37:10 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
771 | 132 |
! ! |
133 |
||
134 |
!JavaClassContentRef2 methodsFor:'printing'! |
|
135 |
||
915 | 136 |
displayString |
137 |
"superclass JavaRef2 says that I am responsible to implement this method" |
|
138 |
||
139 |
^ self classRef displayString , '.' , self name |
|
140 |
||
141 |
"Created: / 14-08-2011 / 21:18:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
142 |
! |
|
143 |
||
771 | 144 |
printString |
777 | 145 |
^ 'JavaClassContentRef: class=[' , self classRef printString , '] name=[' |
146 |
, self nameAndType printString , ']'. |
|
771 | 147 |
|
148 |
"Created: / 10-05-2011 / 14:15:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
777 | 149 |
"Modified: / 12-05-2011 / 18:40:02 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
758 | 150 |
! ! |
151 |
||
152 |
!JavaClassContentRef2 methodsFor:'resolving'! |
|
153 |
||
761 | 154 |
invalidate |
778
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
777
diff
changeset
|
155 |
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
|
156 |
classCache := nil. |
9635f32d1723
implemented deeper caching in new resolving refs to help keeping C-code lean and clean
hlopkmar
parents:
778
diff
changeset
|
157 |
nameAndTypeCache := nil. |
771 | 158 |
super invalidate. |
761 | 159 |
|
160 |
"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
|
161 |
"Modified: / 18-05-2011 / 12:41:35 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
761 | 162 |
! |
163 |
||
758 | 164 |
invalidateForClass: internalJavaClassName |
165 |
"Invalidate (means call invalidate) reference if it has something to do with given class (e.g Class named internalJavaClassName was unloaded). |
|
166 |
Return true, if reference was invalidated." |
|
167 |
||
1372
dea574a1b6b3
Some initial class reloading support. Not yet finished, just sketched out.
vranyj1
parents:
1155
diff
changeset
|
168 |
(self classRef invalidateForClass: internalJavaClassName) ifTrue: [ |
dea574a1b6b3
Some initial class reloading support. Not yet finished, just sketched out.
vranyj1
parents:
1155
diff
changeset
|
169 |
self invalidate. |
dea574a1b6b3
Some initial class reloading support. Not yet finished, just sketched out.
vranyj1
parents:
1155
diff
changeset
|
170 |
^ true |
dea574a1b6b3
Some initial class reloading support. Not yet finished, just sketched out.
vranyj1
parents:
1155
diff
changeset
|
171 |
]. |
777 | 172 |
^ false. |
758 | 173 |
|
777 | 174 |
"Modified: / 12-05-2011 / 18:40:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
1372
dea574a1b6b3
Some initial class reloading support. Not yet finished, just sketched out.
vranyj1
parents:
1155
diff
changeset
|
175 |
"Modified (format): / 21-02-2012 / 10:21:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
758 | 176 |
! ! |
177 |
||
752 | 178 |
!JavaClassContentRef2 class methodsFor:'documentation'! |
179 |
||
1864 | 180 |
version_HG |
181 |
||
182 |
^ '$Changeset: <not expanded> $' |
|
183 |
! |
|
184 |
||
752 | 185 |
version_SVN |
1864 | 186 |
^ '§Id§' |
752 | 187 |
! ! |