author | hlopkmar |
Fri, 30 Nov 2012 20:52:11 +0000 | |
branch | development |
changeset 1844 | 7f4dd9a13c2c |
parent 1818 | 2e5ed72e7dfd |
child 1864 | 60a8dc26c8c6 |
permissions | -rw-r--r-- |
752 | 1 |
" |
877 | 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 |
||
752 | 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. |
|
877 | 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 |
752 | 20 |
" |
21 |
"{ Package: 'stx:libjava' }" |
|
22 |
||
23 |
Object subclass:#JavaObject |
|
1691 | 24 |
instanceVariableNames:'_lockWord_' |
752 | 25 |
classVariableNames:'' |
26 |
poolDictionaries:'' |
|
27 |
category:'Languages-Java-Classes' |
|
28 |
! |
|
29 |
||
30 |
!JavaObject class methodsFor:'documentation'! |
|
31 |
||
32 |
copyright |
|
33 |
" |
|
877 | 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 |
||
752 | 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. |
|
877 | 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 |
|
752 | 53 |
" |
1691 | 54 |
! |
55 |
||
56 |
documentation |
|
57 |
" |
|
58 |
'Proto' class for all Java classes: java.lang.Object inherits |
|
59 |
from JavaObject class. Methods provided here are provides a 'glue' |
|
60 |
code necessary to integrate Java objects into Smalltalk world. |
|
61 |
||
62 |
The 'lock' instance variable here is to support Java monitors. |
|
63 |
It contains either smalltinteger with lockword or a reference to |
|
64 |
full JavaMonitor. |
|
65 |
||
66 |
[author:] |
|
67 |
Claus Gittinger |
|
68 |
Jan Vrany <jan.vrany@fit.cvut.cz> |
|
69 |
||
70 |
[instance variables:] |
|
71 |
_lockWord_ <SmallInteger|JavaMonitor> either thin-locing lock word |
|
72 |
or fat-lock (JavaMonitor). The funny name |
|
73 |
here is to prevent name clashes |
|
74 |
||
75 |
[class variables:] |
|
76 |
||
77 |
[see also:] |
|
78 |
||
79 |
" |
|
752 | 80 |
! ! |
81 |
||
82 |
!JavaObject class methodsFor:'misc'! |
|
83 |
||
84 |
resolveClassRefs |
|
85 |
! |
|
86 |
||
87 |
resolveClassRefsIgnoring:setOfClasses |
|
88 |
! ! |
|
89 |
||
90 |
!JavaObject class methodsFor:'smalltalk interface'! |
|
91 |
||
92 |
convertJavaObject:val signature:retValSignature |
|
93 |
^ val. |
|
94 |
||
95 |
retValSignature = 'void' ifTrue:[ |
|
96 |
^ #void |
|
97 |
]. |
|
98 |
retValSignature = 'boolean' ifTrue:[ |
|
99 |
val == 0 ifTrue:[^ false]. |
|
100 |
^ true |
|
101 |
]. |
|
102 |
retValSignature = 'int' ifTrue:[ |
|
103 |
val isInteger ifFalse:[ |
|
104 |
self halt |
|
105 |
]. |
|
106 |
^ val |
|
107 |
]. |
|
108 |
retValSignature = 'char[]' ifTrue:[ |
|
109 |
"/ these are ST-strings |
|
110 |
^ val |
|
111 |
]. |
|
112 |
||
113 |
retValSignature = 'char' ifTrue:[ |
|
114 |
"/ these are ST-characters |
|
115 |
val isInteger ifTrue:[ |
|
116 |
^ Character value:val |
|
117 |
]. |
|
118 |
self halt. |
|
119 |
^ val |
|
120 |
]. |
|
121 |
||
122 |
retValSignature = 'Object' ifTrue:[ |
|
123 |
^ val |
|
124 |
]. |
|
125 |
||
126 |
retValSignature = 'String' ifTrue:[ |
|
127 |
^ Java as_ST_String:val |
|
128 |
]. |
|
129 |
||
130 |
'no conversion for: ' print. val class name print. ' to: ' print. retValSignature printNL. |
|
131 |
^ val. |
|
132 |
||
133 |
"Modified: 8.8.1997 / 12:07:23 / cg" |
|
134 |
! |
|
135 |
||
136 |
javaStringFrom:aString |
|
137 |
"hard-coding internas of java.lang.String here is bad ..." |
|
138 |
||
139 |
self halt. |
|
140 |
^ Java as_String:aString |
|
141 |
||
142 |
"Modified: 7.8.1997 / 21:17:32 / cg" |
|
143 |
! |
|
144 |
||
145 |
stringFromJavaString:aJavaString |
|
146 |
"hard-coding internas of java.lang.String here is bad ..." |
|
147 |
||
148 |
self halt. |
|
149 |
^ Java as_ST_String:aJavaString |
|
150 |
||
151 |
"Modified: 8.8.1997 / 12:07:29 / cg" |
|
152 |
! ! |
|
153 |
||
1691 | 154 |
!JavaObject methodsFor:'accessing-Java'! |
155 |
||
156 |
getJavaLockWord |
|
157 |
"Returns a Java lock word for given object. The returned |
|
158 |
value is |
|
159 |
- either SmallInteger that encodes the thinlock |
|
160 |
- or a fat lock, instance of JavaMonitor |
|
161 |
" |
|
162 |
||
163 |
"/For nonJava objects, always return fatlock |
|
164 |
||
165 |
^_lockWord_ |
|
166 |
||
167 |
"Created: / 26-08-2012 / 14:03:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
168 |
! |
|
169 |
||
170 |
getJavaMonitor |
|
171 |
"Returns fat JavaMonitor associated with the receiver" |
|
172 |
||
173 |
"/ For Java objects, check if there is allready a thinlock, |
|
174 |
"/ inflate it and return the fatlock |
|
175 |
||
176 |
_lockWord_ class == SmallInteger ifTrue:[ |
|
177 |
_lockWord_ := JavaVM inflateLockFor: self lockword: _lockWord_. |
|
178 |
]. |
|
179 |
^_lockWord_ |
|
180 |
||
181 |
"Created: / 26-08-2012 / 18:35:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
182 |
! |
|
183 |
||
184 |
setJavaLockWord: lockWordOrJavaMonitor |
|
185 |
"Sets a Java lock word for receiver to lockWordOrJavaMonitor. |
|
186 |
The lockWordOrJavaMonitor must be: |
|
187 |
- either SmallInteger that encodes the thinlock |
|
188 |
- or a fat lock, instance of JavaMonitor |
|
189 |
" |
|
190 |
||
191 |
"/for non-Java objects, store fat lock in LockTable in JavaVM |
|
192 |
||
193 |
^_lockWord_ := lockWordOrJavaMonitor |
|
194 |
||
195 |
"Created: / 26-08-2012 / 14:07:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
196 |
! ! |
|
197 |
||
1427
13f3765a9bba
Some experiments with Exceptions, not that easy :-)
vranyj1
parents:
1394
diff
changeset
|
198 |
!JavaObject methodsFor:'exception handling support'! |
13f3765a9bba
Some experiments with Exceptions, not that easy :-)
vranyj1
parents:
1394
diff
changeset
|
199 |
|
1626 | 200 |
catchInDebugger |
201 |
"if set, the debugger will handle this signal in its event loop and will close itself |
|
202 |
without asking for close-confirmation. |
|
203 |
This allows for debugged processes to be terminated without a user confirmation dialog |
|
204 |
(for now, this is used in expecco's hard-terminate function to shut down any open debuggers |
|
205 |
together with the test-process). |
|
206 |
Dummy here" |
|
207 |
||
208 |
^false |
|
209 |
||
210 |
"Created: / 20-08-2012 / 14:15:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
211 |
! |
|
212 |
||
213 |
description |
|
214 |
||
215 |
self class isThrowable ifTrue:[ |
|
216 |
^self getMessage |
|
217 |
]. |
|
218 |
^super description |
|
219 |
||
220 |
"Created: / 20-08-2012 / 14:19:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
221 |
! |
|
222 |
||
1427
13f3765a9bba
Some experiments with Exceptions, not that easy :-)
vranyj1
parents:
1394
diff
changeset
|
223 |
isQuerySignal |
13f3765a9bba
Some experiments with Exceptions, not that easy :-)
vranyj1
parents:
1394
diff
changeset
|
224 |
|
13f3765a9bba
Some experiments with Exceptions, not that easy :-)
vranyj1
parents:
1394
diff
changeset
|
225 |
^false |
1328 | 226 |
|
1427
13f3765a9bba
Some experiments with Exceptions, not that easy :-)
vranyj1
parents:
1394
diff
changeset
|
227 |
"Created: / 18-03-2012 / 13:11:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
13f3765a9bba
Some experiments with Exceptions, not that easy :-)
vranyj1
parents:
1394
diff
changeset
|
228 |
! |
1328 | 229 |
|
1427
13f3765a9bba
Some experiments with Exceptions, not that easy :-)
vranyj1
parents:
1394
diff
changeset
|
230 |
parent |
13f3765a9bba
Some experiments with Exceptions, not that easy :-)
vranyj1
parents:
1394
diff
changeset
|
231 |
"Required for old instance based exceptions, sigh" |
13f3765a9bba
Some experiments with Exceptions, not that easy :-)
vranyj1
parents:
1394
diff
changeset
|
232 |
^nil |
13f3765a9bba
Some experiments with Exceptions, not that easy :-)
vranyj1
parents:
1394
diff
changeset
|
233 |
|
13f3765a9bba
Some experiments with Exceptions, not that easy :-)
vranyj1
parents:
1394
diff
changeset
|
234 |
"Created: / 18-03-2012 / 13:26:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1626 | 235 |
! |
236 |
||
237 |
signal |
|
238 |
||
239 |
self class isThrowable ifTrue:[ |
|
240 |
^self class. |
|
241 |
]. |
|
242 |
^super signal |
|
243 |
||
244 |
"Created: / 20-08-2012 / 14:15:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1328 | 245 |
! ! |
246 |
||
1109
9bd0544f9046
Initial version of finalize() support - may crash VM!
vranyj1
parents:
1093
diff
changeset
|
247 |
!JavaObject methodsFor:'finalization'! |
9bd0544f9046
Initial version of finalize() support - may crash VM!
vranyj1
parents:
1093
diff
changeset
|
248 |
|
1548 | 249 |
finalizationLobby |
250 |
||
1549 | 251 |
"/ ^super finalizationLobby |
1109
9bd0544f9046
Initial version of finalize() support - may crash VM!
vranyj1
parents:
1093
diff
changeset
|
252 |
|
1549 | 253 |
^JavaVM finalizationLobby "/ Do not use this yet!! |
1109
9bd0544f9046
Initial version of finalize() support - may crash VM!
vranyj1
parents:
1093
diff
changeset
|
254 |
|
1548 | 255 |
"Created: / 24-07-2012 / 01:04:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1109
9bd0544f9046
Initial version of finalize() support - may crash VM!
vranyj1
parents:
1093
diff
changeset
|
256 |
! ! |
9bd0544f9046
Initial version of finalize() support - may crash VM!
vranyj1
parents:
1093
diff
changeset
|
257 |
|
752 | 258 |
!JavaObject methodsFor:'initialization'! |
259 |
||
1502
8caaac85827f
Initialization of Java Classes changed to be compatible with TO (I hope I did not broke anything!)
kursjan
parents:
1478
diff
changeset
|
260 |
initialize |
8caaac85827f
Initialization of Java Classes changed to be compatible with TO (I hope I did not broke anything!)
kursjan
parents:
1478
diff
changeset
|
261 |
self perform:#'<init>()V'. |
8caaac85827f
Initialization of Java Classes changed to be compatible with TO (I hope I did not broke anything!)
kursjan
parents:
1478
diff
changeset
|
262 |
|
8caaac85827f
Initialization of Java Classes changed to be compatible with TO (I hope I did not broke anything!)
kursjan
parents:
1478
diff
changeset
|
263 |
"Created: / 09-06-2012 / 21:49:37 / Jan Kurs (kursjan@fit.cvut.cz)" |
8caaac85827f
Initialization of Java Classes changed to be compatible with TO (I hope I did not broke anything!)
kursjan
parents:
1478
diff
changeset
|
264 |
! |
8caaac85827f
Initialization of Java Classes changed to be compatible with TO (I hope I did not broke anything!)
kursjan
parents:
1478
diff
changeset
|
265 |
|
752 | 266 |
initializeToZero |
267 |
|sz| |
|
268 |
||
269 |
sz := self class instSize. |
|
270 |
1 to:sz do:[:i | |
|
271 |
self instVarAt:i put:0 |
|
272 |
] |
|
273 |
! ! |
|
274 |
||
1213
fc90769151e8
- fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents:
1209
diff
changeset
|
275 |
!JavaObject methodsFor:'inspecting'! |
fc90769151e8
- fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents:
1209
diff
changeset
|
276 |
|
fc90769151e8
- fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents:
1209
diff
changeset
|
277 |
inspectorExtraAttributes |
fc90769151e8
- fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents:
1209
diff
changeset
|
278 |
|
fc90769151e8
- fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents:
1209
diff
changeset
|
279 |
| attrs nm | |
fc90769151e8
- fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents:
1209
diff
changeset
|
280 |
|
fc90769151e8
- fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents:
1209
diff
changeset
|
281 |
attrs := super inspectorExtraAttributes. |
fc90769151e8
- fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents:
1209
diff
changeset
|
282 |
nm := self class name. |
fc90769151e8
- fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents:
1209
diff
changeset
|
283 |
nm == #'java/lang/reflect/Method' ifTrue:[ |
fc90769151e8
- fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents:
1209
diff
changeset
|
284 |
attrs at:'-method' put: (JavaVM reflection methodForJavaMethodObject: self). |
fc90769151e8
- fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents:
1209
diff
changeset
|
285 |
^attrs. |
fc90769151e8
- fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents:
1209
diff
changeset
|
286 |
]. |
1242 | 287 |
nm == #'java/lang/Class' ifTrue:[ |
1213
fc90769151e8
- fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents:
1209
diff
changeset
|
288 |
attrs at:'-class' put: (JavaVM reflection classForJavaClassObject: self). |
fc90769151e8
- fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents:
1209
diff
changeset
|
289 |
^attrs. |
fc90769151e8
- fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents:
1209
diff
changeset
|
290 |
]. |
fc90769151e8
- fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents:
1209
diff
changeset
|
291 |
^attrs |
fc90769151e8
- fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents:
1209
diff
changeset
|
292 |
|
fc90769151e8
- fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents:
1209
diff
changeset
|
293 |
"Created: / 04-12-2011 / 19:28:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
fc90769151e8
- fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents:
1209
diff
changeset
|
294 |
! ! |
fc90769151e8
- fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents:
1209
diff
changeset
|
295 |
|
752 | 296 |
|
297 |
!JavaObject methodsFor:'printing & storing'! |
|
298 |
||
1478 | 299 |
basicPrintOn: aStream |
300 |
aStream nextPutAll: self class name. |
|
301 |
aStream nextPut:$@. |
|
302 |
self identityHash printOn: aStream. |
|
303 |
||
304 |
"Created: / 13-04-2012 / 17:34:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
305 |
! |
|
306 |
||
752 | 307 |
displayString |
308 |
||
1209 | 309 |
JavaVM booted ifTrue:[ |
1478 | 310 |
| toStringM toString | |
311 |
toStringM := self class lookupSelector: #'toString()Ljava/lang/String;'. |
|
312 |
(toStringM javaClass name ~~ #'java/lang/Object') ifTrue:[ |
|
313 |
[ |
|
314 |
toString := Java as_ST_String:(self perform:#'toString()Ljava/lang/String;'). |
|
315 |
] on: Error do: [ |
|
316 |
toString := nil |
|
317 |
]. |
|
318 |
]. |
|
1209 | 319 |
toString notNil ifTrue:[ |
320 |
^toString |
|
321 |
] |
|
752 | 322 |
]. |
1478 | 323 |
^String streamContents: [:s|self basicPrintOn: s] |
752 | 324 |
|
325 |
"Modified: / 04-11-1998 / 18:35:00 / cg" |
|
326 |
"Modified: / 28-01-2011 / 15:10:05 / Marcel Hlopko <hlopik@gmail.com>" |
|
1478 | 327 |
"Modified: / 13-04-2012 / 17:38:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
752 | 328 |
! |
329 |
||
1209 | 330 |
printOn: aStream |
331 |
|myClassName | |
|
752 | 332 |
|
1209 | 333 |
myClassName := self class name. |
334 |
myClassName == #'java/lang/String' ifTrue:[ |
|
335 |
aStream nextPut:$". |
|
336 |
aStream nextPutAll: (Java as_ST_String: self). |
|
337 |
aStream nextPut:$". |
|
338 |
^self. |
|
752 | 339 |
]. |
1209 | 340 |
myClassName == #'java/lang/Class' ifTrue:[ |
341 |
super printOn: aStream. |
|
342 |
aStream nextPut: $(. |
|
1648 | 343 |
(JavaVM reflection classForJavaClassObject:self) javaMirror getName printOn: aStream. |
1209 | 344 |
aStream nextPut: $). |
345 |
^self. |
|
752 | 346 |
]. |
1209 | 347 |
myClassName == #'java.lang.reflect.Method' ifTrue:[ |
348 |
super printOn: aStream. |
|
349 |
aStream nextPut: $(. |
|
350 |
(JavaVM reflection methodForJavaMethodObject:self) printOn: aStream. |
|
351 |
aStream nextPut: $). |
|
352 |
^self. |
|
752 | 353 |
]. |
354 |
||
1209 | 355 |
JavaVM booted ifTrue:[ |
356 |
| toString | |
|
357 |
[ toString := Java as_ST_String:(self perform:#'toString()Ljava/lang/String;').] |
|
358 |
on: Error do: [ toString := nil ]. |
|
359 |
toString notNil ifTrue:[ |
|
360 |
"/super printOn: aStream. |
|
361 |
"/aStream nextPut: $(. |
|
362 |
aStream nextPutAll: toString. |
|
363 |
"/aStream nextPut: $). |
|
364 |
^self. |
|
365 |
] |
|
366 |
]. |
|
367 |
super printOn: aStream. |
|
368 |
||
369 |
"Created: / 04-12-2011 / 10:29:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
752 | 370 |
! ! |
371 |
||
372 |
!JavaObject methodsFor:'queries'! |
|
373 |
||
374 |
isJavaClassRef |
|
375 |
^ false |
|
376 |
||
377 |
"Created: / 9.11.1999 / 17:13:37 / cg" |
|
378 |
! |
|
379 |
||
380 |
isJavaMethodRef |
|
381 |
^ false |
|
382 |
||
383 |
"Created: / 9.11.1999 / 15:43:21 / cg" |
|
384 |
! |
|
385 |
||
386 |
isJavaObject |
|
387 |
^ true |
|
388 |
||
389 |
"Created: 26.3.1997 / 13:34:17 / cg" |
|
1394 | 390 |
! |
391 |
||
392 |
size |
|
393 |
"What a hack!!!!!!" |
|
394 |
||
395 |
^(self respondsTo:#'size()I') ifTrue:[ |
|
396 |
self perform:#'size()I' |
|
397 |
] ifFalse:[ |
|
398 |
super size. |
|
399 |
] |
|
400 |
||
401 |
"Created: / 29-02-2012 / 14:25:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
752 | 402 |
! ! |
403 |
||
404 |
!JavaObject methodsFor:'smalltalk interface'! |
|
405 |
||
406 |
lookupMethod:selector numArgs:nargs |
|
407 |
"lookup a method" |
|
408 |
||
409 |
|method cls sel| |
|
410 |
||
411 |
sel := selector. |
|
412 |
(sel includes:$:) ifTrue:[ |
|
413 |
sel := sel copyTo:(sel indexOf:$:)-1 |
|
414 |
]. |
|
415 |
||
416 |
sel := sel asSymbolIfInterned. |
|
417 |
sel notNil ifTrue:[ |
|
418 |
cls := self class. |
|
419 |
[cls notNil and:[cls ~~ JavaObject]] whileTrue:[ |
|
420 |
cls methodDictionary keysAndValuesDo:[:jSel :aMethod | |
|
421 |
(jSel == sel ) ifTrue:[ |
|
422 |
^ aMethod |
|
423 |
] |
|
424 |
]. |
|
425 |
cls methodDictionary keysAndValuesDo:[:jSel :aMethod | |
|
426 |
(aMethod name = sel |
|
427 |
or:[aMethod signatureNameWithoutReturnType = sel]) ifTrue:[ |
|
428 |
aMethod numArgs == nargs ifTrue:[ |
|
429 |
^ aMethod |
|
430 |
] |
|
431 |
] |
|
432 |
]. |
|
433 |
cls := cls superclass. |
|
434 |
]. |
|
435 |
]. |
|
436 |
||
437 |
^ nil |
|
438 |
||
439 |
" |
|
440 |
|stack| |
|
441 |
||
442 |
stack := (Java at:'java.util.Stack') basicNew. |
|
443 |
stack lookupMethod:#'<init>' numArgs:0. |
|
444 |
" |
|
445 |
" |
|
446 |
|stack| |
|
447 |
||
448 |
stack := (Java at:'java.util.Stack') new. |
|
449 |
stack lookupMethod:#isEmpty numArgs:0. |
|
450 |
" |
|
451 |
" |
|
452 |
|frame| |
|
453 |
||
454 |
frame := (Java at:'java.awt.Frame') new. |
|
455 |
frame lookupMethod:#'<init> (String)' numArgs:1. |
|
456 |
" |
|
457 |
||
458 |
"Modified: 22.3.1997 / 00:56:54 / cg" |
|
459 |
! ! |
|
460 |
||
1093 | 461 |
!JavaObject methodsFor:'unwind'! |
462 |
||
463 |
unwindHandlerInContext: aContext |
|
464 |
"given a context which has been marked for unwind, |
|
465 |
retrieve the handler block. This method is called when ST |
|
466 |
exception raises and stack is unwinding. JavaClass instance |
|
467 |
has an opportunity to clean up monitors" |
|
468 |
||
469 |
^ JavaVM unwindHandlerForJavaContext: aContext. |
|
470 |
||
471 |
"Created: / 08-11-2011 / 12:25:15 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
472 |
! ! |
|
473 |
||
752 | 474 |
!JavaObject class methodsFor:'documentation'! |
475 |
||
476 |
version |
|
1022 | 477 |
^ '$Id$' |
752 | 478 |
! |
479 |
||
480 |
version_SVN |
|
1022 | 481 |
^ '$Id$' |
949
8452984ed807
New Implementation of JavaLookup. Slow, no boxing, unboxing is old and needs to be rewritten.
kursjan
parents:
923
diff
changeset
|
482 |
! ! |
1691 | 483 |