author | vranyj1 |
Fri, 24 Feb 2012 17:57:26 +0000 | |
branch | jk_new_structure |
changeset 1384 | d62dd4b29c22 |
parent 1383 | 2be65ff08ca5 |
child 1385 | 3426388640da |
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 |
CompiledCode variableSubclass:#JavaMethod |
|
948 | 24 |
instanceVariableNames:'accessFlags selector javaClass descriptor signature lookupObject |
25 |
lineNumberTable localVariableTable sourceLineNumber annotations' |
|
26 |
classVariableNames:'AbstractMethodInvokationSignal SignatureTypeCodes |
|
27 |
ForceByteCodeDisplay UnresolvedClassSignal A_PUBLIC A_PRIVATE |
|
28 |
A_PROTECTED A_STATIC A_FINAL A_SYNCHRONIZED A_ABSTRACT A_NATIVE |
|
29 |
A_BREAKPOINT R_VOID R_LONG R_DOUBLE A_HASHANDLER A_BRIDGE |
|
1354 | 30 |
A_VARARGS A_STRICT A_SYNTHETIC A_RESOLVED' |
1046 | 31 |
poolDictionaries:'JavaConstants' |
948 | 32 |
category:'Languages-Java-Classes' |
752 | 33 |
! |
34 |
||
35 |
!JavaMethod class methodsFor:'documentation'! |
|
36 |
||
37 |
copyright |
|
38 |
" |
|
877 | 39 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
1152 | 40 |
|
1155 | 41 |
New code and modifications done at SWING Research Group [1]: |
1152 | 42 |
|
877 | 43 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
44 |
SWING Research Group, Czech Technical University in Prague |
|
45 |
||
752 | 46 |
This software is furnished under a license and may be used |
47 |
only in accordance with the terms of that license and with the |
|
48 |
inclusion of the above copyright notice. This software may not |
|
49 |
be provided or otherwise made available to, or used by, any |
|
50 |
other person. No title to or ownership of the software is |
|
51 |
hereby transferred. |
|
877 | 52 |
|
1155 | 53 |
[1] Code written at SWING Research Group contains a signature |
54 |
of one of the above copright owners. For exact set of such code, |
|
55 |
see the differences between this version and version stx:libjava |
|
1152 | 56 |
as of 1.9.2010 |
877 | 57 |
|
752 | 58 |
" |
59 |
! ! |
|
60 |
||
61 |
!JavaMethod class methodsFor:'initialization'! |
|
62 |
||
63 |
initialize |
|
64 |
AbstractMethodInvokationSignal isNil ifTrue:[ |
|
65 |
AbstractMethodInvokationSignal := ExecutionError newSignalMayProceed:true. |
|
66 |
AbstractMethodInvokationSignal nameClass:self message:#abstractMethodInvokationSignal. |
|
67 |
AbstractMethodInvokationSignal notifierString:'attempt to execute abstract method'. |
|
68 |
||
69 |
UnresolvedClassSignal := ExecutionError newSignalMayProceed:true. |
|
70 |
UnresolvedClassSignal nameClass:self message:#unresolvedClassSignal. |
|
71 |
UnresolvedClassSignal notifierString:'unresolved class'. |
|
72 |
]. |
|
73 |
||
74 |
A_PUBLIC := 16r0001. |
|
75 |
A_PRIVATE := 16r0002. |
|
76 |
A_PROTECTED := 16r0004. |
|
77 |
A_STATIC := 16r0008. |
|
78 |
A_FINAL := 16r0010. |
|
79 |
A_SYNCHRONIZED := 16r0020. |
|
80 |
A_BRIDGE := 16r0040. |
|
81 |
A_VARARGS := 16r0080. |
|
82 |
A_NATIVE := 16r0100. |
|
83 |
A_ABSTRACT := 16r0400. |
|
84 |
A_STRICT := 16r0800. |
|
85 |
A_SYNTHETIC := 16r1000. |
|
86 |
||
1051 | 87 |
R_VOID := 16r01000000. |
88 |
R_LONG := 16r02000000. |
|
89 |
R_DOUBLE := 16r04000000. |
|
90 |
||
1111
7feb6c5ffbc4
JavaMethod: fixed constants value for A_BREAKPNT (fixes breakpoint support for Java methods)
vranyj1
parents:
1055
diff
changeset
|
91 |
A_BREAKPOINT := 16r10000000. |
7feb6c5ffbc4
JavaMethod: fixed constants value for A_BREAKPNT (fixes breakpoint support for Java methods)
vranyj1
parents:
1055
diff
changeset
|
92 |
A_HASHANDLER := 16r20000000. |
1354 | 93 |
A_RESOLVED := 16r40000000. |
752 | 94 |
|
95 |
self flags:(self flags bitOr:Behavior flagJavaMethod). |
|
96 |
||
97 |
SignatureTypeCodes := IdentityDictionary new. |
|
98 |
SignatureTypeCodes at:$B put:#byte. |
|
99 |
SignatureTypeCodes at:$C put:#char. |
|
100 |
SignatureTypeCodes at:$D put:#double. |
|
101 |
SignatureTypeCodes at:$F put:#float. |
|
102 |
SignatureTypeCodes at:$I put:#int. |
|
103 |
SignatureTypeCodes at:$J put:#long. |
|
104 |
SignatureTypeCodes at:$S put:#'unsigned short'. |
|
105 |
SignatureTypeCodes at:$Z put:#boolean. |
|
106 |
SignatureTypeCodes at:$L put:#object. |
|
107 |
SignatureTypeCodes at:$[ put:#array. |
|
912
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
108 |
SignatureTypeCodes at:$T put:#typevar. |
752 | 109 |
|
110 |
ForceByteCodeDisplay := false. |
|
111 |
||
112 |
" |
|
113 |
JavaMethod initialize. |
|
114 |
JavaMethodWithHandler initialize. |
|
115 |
ForceByteCodeDisplay := true. |
|
116 |
ForceByteCodeDisplay := false. |
|
117 |
" |
|
118 |
||
912
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
119 |
"Modified: / 16-10-1998 / 01:29:48 / cg" |
1111
7feb6c5ffbc4
JavaMethod: fixed constants value for A_BREAKPNT (fixes breakpoint support for Java methods)
vranyj1
parents:
1055
diff
changeset
|
120 |
"Modified: / 14-11-2011 / 23:54:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
752 | 121 |
! |
122 |
||
123 |
reinitialize |
|
124 |
||
125 |
self flags:(self flags bitOr:Behavior flagJavaMethod). |
|
126 |
||
127 |
"Created: / 14-12-2010 / 20:58:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
128 |
! ! |
|
129 |
||
130 |
!JavaMethod class methodsFor:'instance creation'! |
|
131 |
||
132 |
fromMethod:aJavaMethod |
|
133 |
"create a new javaMethod, copying values from another javaMethod" |
|
134 |
||
135 |
^ self new fromMethod:aJavaMethod |
|
136 |
||
137 |
"Created: / 16.10.1998 / 01:25:12 / cg" |
|
138 |
! |
|
139 |
||
140 |
new |
|
141 |
"create a new javaMethod. |
|
142 |
Redefined, since constants are NOT stored in a literalArray, |
|
143 |
but my classes constantTable instead." |
|
144 |
||
145 |
^ self basicNew:0. |
|
146 |
||
147 |
"Created: / 16.10.1998 / 01:13:02 / cg" |
|
148 |
! ! |
|
149 |
||
150 |
!JavaMethod class methodsFor:'Signal constants'! |
|
151 |
||
152 |
abstractMethodInvokationSignal |
|
153 |
"return the signal raised when an abstract method is invoked" |
|
154 |
||
155 |
^ AbstractMethodInvokationSignal |
|
156 |
||
157 |
"Created: / 27.1.1998 / 21:50:05 / cg" |
|
158 |
! |
|
159 |
||
160 |
unresolvedClassSignal |
|
161 |
"return the signal raised when an unresolved class is referenced" |
|
162 |
||
163 |
^ UnresolvedClassSignal |
|
164 |
||
165 |
"Created: / 27.1.1998 / 21:50:05 / cg" |
|
166 |
! ! |
|
167 |
||
168 |
!JavaMethod class methodsFor:'misc'! |
|
169 |
||
170 |
forceByteCodeDisplay |
|
171 |
^ ForceByteCodeDisplay |
|
172 |
||
173 |
"Created: 7.4.1997 / 20:11:39 / cg" |
|
174 |
! |
|
175 |
||
176 |
forceByteCodeDisplay:aBoolean |
|
177 |
ForceByteCodeDisplay := aBoolean |
|
178 |
||
179 |
" |
|
180 |
self forceByteCodeDisplay:true |
|
181 |
self forceByteCodeDisplay:false |
|
182 |
" |
|
183 |
||
184 |
"Created: / 4.2.1998 / 00:22:54 / cg" |
|
185 |
! |
|
186 |
||
187 |
makeJavaMethod |
|
188 |
||
189 |
self flags:((self flags |
|
190 |
bitOr:Behavior flagJavaMethod) |
|
191 |
bitClear:Behavior flagMetaMethod) |
|
192 |
||
193 |
" |
|
194 |
JavaMethod makeJavaMethod |
|
195 |
JavaMethod makeMetaMethod |
|
196 |
" |
|
197 |
||
198 |
"Created: / 23-02-2011 / 12:56:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
199 |
! |
|
200 |
||
201 |
makeMetaMethod |
|
202 |
||
203 |
self flags:((self flags |
|
204 |
bitOr:Behavior flagMetaMethod) |
|
205 |
bitClear:Behavior flagJavaMethod) |
|
206 |
" |
|
207 |
JavaMethod makeJavaMethod |
|
208 |
JavaMethod makeMetaMethod |
|
209 |
" |
|
210 |
||
211 |
"Created: / 23-02-2011 / 12:56:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
212 |
! ! |
|
213 |
||
214 |
!JavaMethod class methodsFor:'signature parsing'! |
|
215 |
||
216 |
argSigArrayFromSignature:aSignature |
|
217 |
"given a signature, return a specArray for the arguments" |
|
218 |
||
219 |
|s| |
|
220 |
||
221 |
s := aSignature readStream. |
|
222 |
s next ~~ $( ifTrue:[self halt]. |
|
223 |
||
224 |
^ self argSigArrayFromStream:s. |
|
225 |
||
226 |
" |
|
227 |
JavaMethod argSigArrayFromSignature:'(LObject;)V' |
|
228 |
JavaMethod argSigArrayFromSignature:'(BB)S' |
|
229 |
JavaMethod argSigArrayFromSignature:'(LObject;LObject;II)V' |
|
230 |
" |
|
231 |
! |
|
232 |
||
233 |
argSigArrayFromStream:s |
|
234 |
"parse an argSpec, return an array of specs - see java doc" |
|
235 |
||
236 |
|argSpec spec| |
|
237 |
||
238 |
spec := #(). |
|
239 |
[s atEnd or:[s peek == $)]] whileFalse:[ |
|
240 |
"/ s peek == Character space ifTrue:[ |
|
241 |
"/ s next |
|
242 |
"/ ] ifFalse:[ |
|
923 | 243 |
argSpec := self fieldTypeFromStream:s in:nil. |
244 |
spec := spec copyWith:argSpec. |
|
752 | 245 |
"/ ] |
246 |
]. |
|
247 |
^ spec |
|
248 |
||
249 |
"Modified: / 8.1.1998 / 19:10:20 / cg" |
|
250 |
! |
|
251 |
||
252 |
argSignatureFromArgTypeArray:arr |
|
253 |
| sig | |
|
254 |
||
255 |
sig := ''. |
|
256 |
arr do: |
|
257 |
[:el | |
|
258 |
| jCLass | |
|
259 |
||
260 |
jCLass := el. |
|
261 |
jCLass isJavaClass |
|
262 |
ifFalse:[ jCLass := JavaVM reflection classForJavaClassObject:el ]. |
|
263 |
jCLass isJavaClass |
|
264 |
ifTrue: |
|
265 |
[ sig := sig , jCLass typeName. |
|
266 |
] |
|
267 |
ifFalse:[ self halt. ] ]. |
|
268 |
^ sig |
|
269 |
||
270 |
" |
|
271 |
self argSignatureFromArgTypeArray: |
|
272 |
(Array |
|
273 |
with:(JavaVM javaClassObjectForClass:(Java at:'com.sun.java.swing.JComponent')))" |
|
274 |
||
275 |
"Modified: / 13-02-1998 / 14:57:58 / cg" |
|
276 |
"Modified: / 02-03-2011 / 22:49:24 / Marcel Hlopko <hlopik@gmail.com>" |
|
277 |
! |
|
278 |
||
279 |
argSpecFromSignature:aSignature withName:name |
|
280 |
"given a signature, return a spec" |
|
281 |
||
282 |
|s argSpec| |
|
283 |
||
284 |
s := aSignature readStream. |
|
285 |
s next ~~ $( ifTrue:[self halt. ^ name]. |
|
286 |
||
287 |
argSpec := self argSpecFromStream:s in:nil. |
|
288 |
||
289 |
s next ~~ $) ifTrue:[self halt. ^ name]. |
|
290 |
||
291 |
^ name , ' (' , argSpec , ')' |
|
292 |
||
293 |
" |
|
294 |
JavaMethod argSpecFromSignature:'(LObject;)V' withName:'foo' |
|
295 |
JavaMethod argSpecFromSignature:'(BB)S' withName:'foo' |
|
296 |
" |
|
297 |
||
298 |
"Modified: / 8.1.1998 / 19:05:36 / cg" |
|
299 |
! |
|
300 |
||
301 |
argSpecFromStream:s in:aPackage |
|
302 |
"parse an argSpec - see java doc" |
|
303 |
||
304 |
|argSpec spec| |
|
305 |
||
306 |
spec := ''. |
|
307 |
[s atEnd or:[s peek == $)]] whileFalse:[ |
|
308 |
"/ s peek == Character space ifTrue:[ |
|
309 |
"/ s next |
|
310 |
"/ ] ifFalse:[ |
|
923 | 311 |
argSpec := self fieldTypeFromStream:s in:aPackage. |
312 |
spec size ~~ 0 ifTrue:[ |
|
313 |
spec := spec , ' ' |
|
314 |
]. |
|
315 |
spec := spec , argSpec. |
|
752 | 316 |
"/ ] |
317 |
]. |
|
318 |
^ spec |
|
319 |
||
320 |
"Created: 18.3.1997 / 11:06:44 / cg" |
|
321 |
! |
|
322 |
||
323 |
argSpecWithArgsFromStream:s in:aPackage |
|
324 |
"parse an argSpec - see java doc" |
|
325 |
||
326 |
^ self argSpecWithArgsFromStream:s in:aPackage argNames:nil |
|
327 |
||
328 |
"Modified: / 8.1.1998 / 19:21:00 / cg" |
|
329 |
! |
|
330 |
||
331 |
argSpecWithArgsFromStream:s in:aPackage argNames:argNames |
|
332 |
"parse an argSpec - see java doc" |
|
333 |
||
334 |
|argSpec spec argNr nm| |
|
335 |
||
336 |
argNr := 1. |
|
337 |
spec := ''. |
|
338 |
[s atEnd or:[s peek == $)]] whileFalse:[ |
|
923 | 339 |
argSpec := self fieldTypeFromStream:s in:aPackage. |
340 |
||
341 |
(argNames notNil |
|
342 |
and:[argNames size >= argNr |
|
343 |
and:[(nm := argNames at:argNr) notNil]]) ifFalse:[ |
|
344 |
nm := 'arg' , argNr printString. |
|
345 |
]. |
|
346 |
argSpec := argSpec , ' ' , nm. |
|
347 |
||
348 |
spec size ~~ 0 ifTrue:[ |
|
349 |
spec := spec , ', ' |
|
350 |
]. |
|
351 |
spec := spec , argSpec. |
|
352 |
||
353 |
argNr := argNr + 1. |
|
752 | 354 |
]. |
355 |
^ spec |
|
356 |
||
357 |
"Created: / 8.1.1998 / 19:20:36 / cg" |
|
358 |
"Modified: / 8.1.1998 / 21:14:33 / cg" |
|
359 |
! |
|
360 |
||
361 |
fieldTypeFromStream:s in:aPackage |
|
362 |
"parse a fieldTypeSpec - see java doc" |
|
363 |
||
912
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
364 |
|typeChar typeSym elType size className nm out nangles | |
752 | 365 |
|
366 |
typeChar := s next. |
|
367 |
||
368 |
typeSym := SignatureTypeCodes at:typeChar ifAbsent:#unknown. |
|
369 |
||
370 |
typeSym == #unknown ifTrue:[ |
|
912
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
371 |
^ typeSym |
752 | 372 |
]. |
912
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
373 |
(typeSym == #object or: [typeSym == #typevar]) ifTrue:[ |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
374 |
"Take care about type variables" |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
375 |
out := String new writeStream. |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
376 |
[ s peek ~~ $; and:[ s peek ~~ $< ] ] whileTrue:[ |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
377 |
out nextPut: s next. |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
378 |
]. |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
379 |
className := out contents. |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
380 |
"Eat possible type variables" |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
381 |
(s peek == $<) ifTrue:[ |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
382 |
nangles := 1. s next. |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
383 |
[ nangles ~~ 0 ] whileTrue:[ |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
384 |
s peek == $< ifTrue:[nangles := nangles + 1]. |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
385 |
s peek == $> ifTrue:[nangles := nangles - 1]. |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
386 |
s next. |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
387 |
] |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
388 |
]. |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
389 |
s peek ~~ $; ifTrue:[self error: 'Signature corrupted?']. |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
390 |
s next. "/eat ; |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
391 |
|
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
392 |
|
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
393 |
typeSym == #typevar ifTrue:[^className]. |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
394 |
"/ strip off default |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
395 |
nm := className. |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
396 |
aPackage notNil ifTrue:[ |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
397 |
(nm startsWith:aPackage) ifTrue:[ |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
398 |
nm := nm copyFrom:(aPackage size + 2). |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
399 |
]. |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
400 |
]. |
752 | 401 |
|
912
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
402 |
nm := nm copyReplaceAll:$/ with:$.. |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
403 |
^ nm |
752 | 404 |
]. |
405 |
||
406 |
typeSym == #array ifTrue:[ |
|
912
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
407 |
s peek isDigit ifTrue:[ |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
408 |
size := Integer readFrom:s. |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
409 |
elType := self fieldTypeFromStream:s in:aPackage. |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
410 |
^ elType , '[' , size printString , ']' |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
411 |
]. |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
412 |
elType := self fieldTypeFromStream:s in:aPackage. |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
413 |
^ elType , '[]' |
752 | 414 |
]. |
415 |
||
416 |
^ typeSym |
|
417 |
||
912
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
418 |
"Created: / 18-03-1997 / 11:07:56 / cg" |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
419 |
"Modified: / 18-07-1998 / 22:57:06 / cg" |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
420 |
"Modified: / 13-08-2011 / 01:05:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
752 | 421 |
! |
422 |
||
423 |
numArgsFromSignature:aSignature |
|
424 |
"given a signature, return the number of args" |
|
425 |
||
426 |
|s| |
|
427 |
||
428 |
s := aSignature readStream. |
|
912
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
429 |
(aSignature includes: $() ifFalse:[self error:'Invalid signature']. |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
430 |
[s next ~~ $(] whileTrue. |
752 | 431 |
|
432 |
^ self numArgsFromStream:s. |
|
433 |
||
434 |
" |
|
435 |
JavaMethod numArgsFromSignature:'(LObject;)V' |
|
436 |
JavaMethod numArgsFromSignature:'(BB)S' |
|
437 |
JavaMethod numArgsFromSignature:'()V' |
|
912
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
438 |
JavaMethod numArgsFromSignature:'(Ljava/util/ArrayList<*>;)V' |
752 | 439 |
" |
912
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
440 |
|
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
441 |
"Modified (comment): / 13-08-2011 / 00:59:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
752 | 442 |
! |
443 |
||
444 |
numArgsFromStream:s |
|
445 |
"parse an argSpec - see java doc" |
|
446 |
||
447 |
|n t| |
|
448 |
||
449 |
n := 0. |
|
450 |
[s atEnd or:[s peek == $)]] whileFalse:[ |
|
923 | 451 |
t := self fieldTypeFromStream:s in:nil. |
452 |
"/ |
|
453 |
"/ some args count as 2 |
|
454 |
"/ |
|
455 |
t == #long ifTrue:[ |
|
456 |
n := n + 2. |
|
457 |
] ifFalse:[ |
|
458 |
t == #double ifTrue:[ |
|
459 |
n := n + 2 |
|
460 |
] ifFalse:[ |
|
461 |
n := n + 1. |
|
462 |
] |
|
463 |
] |
|
752 | 464 |
]. |
465 |
^ n |
|
466 |
||
467 |
"Modified: / 8.1.1998 / 19:10:25 / cg" |
|
468 |
! |
|
469 |
||
470 |
retValSpecFromSignature:aSignature in:aPackage |
|
471 |
"given a signature, return a spec" |
|
472 |
||
473 |
|s argSpec retvalSpec| |
|
474 |
||
475 |
s := aSignature readStream. |
|
476 |
s next ~~ $( ifTrue:[self halt]. |
|
477 |
||
478 |
argSpec := self argSpecFromStream:s in:aPackage. |
|
479 |
||
480 |
s next ~~ $) ifTrue:[self halt]. |
|
481 |
||
482 |
retvalSpec := self retvalSpecFromStream:s in:aPackage. |
|
483 |
||
484 |
^ retvalSpec |
|
485 |
||
486 |
" |
|
487 |
JavaMethod retValSpecFromSignature:'(LObject;)V' |
|
488 |
JavaMethod retValSpecFromSignature:'(BB)S' |
|
489 |
" |
|
490 |
||
491 |
"Created: 18.3.1997 / 11:11:50 / cg" |
|
492 |
! |
|
493 |
||
494 |
returnTypeFromSignature:aSignature in:aPackage |
|
495 |
"given a signature, return its type as a string" |
|
496 |
||
497 |
|s c| |
|
498 |
||
499 |
s := aSignature readStream. |
|
500 |
(c := s peek) ~~ $( ifTrue:[ |
|
923 | 501 |
c == $' ifTrue:[ |
502 |
[s peek ~= $'] whileTrue:[s next]. |
|
503 |
s next. |
|
504 |
^ (self retvalSpecFromStream:s in:aPackage) |
|
505 |
]. |
|
506 |
^ (self retvalSpecFromStream:s in:aPackage) |
|
752 | 507 |
]. |
508 |
||
509 |
s next. |
|
510 |
self argSpecFromStream:s in:aPackage. |
|
511 |
s next ~~ $) ifTrue:[self halt. ^ nil]. |
|
512 |
||
513 |
^ (self retvalSpecFromStream:s in:aPackage) |
|
514 |
||
515 |
" |
|
516 |
JavaMethod returnTypeFromSignature:'(LObject;)V' |
|
517 |
JavaMethod returnTypeFromSignature:'(BB)S' |
|
518 |
JavaMethod returnTypeFromSignature:'()J' |
|
519 |
JavaMethod returnTypeFromSignature:'''first''J' |
|
520 |
" |
|
521 |
||
522 |
"Created: / 1.8.1997 / 10:54:31 / cg" |
|
523 |
"Modified: / 8.1.1998 / 19:09:06 / cg" |
|
524 |
! |
|
525 |
||
526 |
returnsVoidFromSignature:aSignature |
|
527 |
"given a signature, return true if it returns void, false if not" |
|
528 |
||
529 |
^ (self typeFromSignature:aSignature in:nil) = 'void' |
|
530 |
||
531 |
" |
|
532 |
JavaMethod returnsVoidFromSignature:'(LObject;)V' |
|
533 |
JavaMethod returnsVoidFromSignature:'(BB)S' |
|
534 |
" |
|
535 |
||
536 |
"Modified: / 8.1.1998 / 19:13:53 / cg" |
|
537 |
! |
|
538 |
||
539 |
retvalSpecFromStream:s in:aPackage |
|
540 |
"parse a retvalSpec - see java doc" |
|
541 |
||
542 |
|spec| |
|
543 |
||
544 |
s atEnd ifTrue:[self halt. ^ #void]. |
|
545 |
s peek == $V ifTrue:[^ #void]. |
|
546 |
spec := self fieldTypeFromStream:s in:aPackage. |
|
547 |
spec knownAsSymbol ifTrue:[ |
|
923 | 548 |
^ spec asSymbol |
752 | 549 |
]. |
550 |
^ spec |
|
551 |
||
552 |
"Created: / 18.3.1997 / 11:12:19 / cg" |
|
553 |
"Modified: / 7.4.1998 / 22:28:27 / cg" |
|
554 |
! |
|
555 |
||
556 |
specComponentsWithArgsFromSignature:aSignature withName:name in:aPackage |
|
557 |
"given a signature, return a spec" |
|
558 |
||
559 |
|s argSpec retvalSpec| |
|
560 |
||
561 |
s := aSignature readStream. |
|
562 |
s next ~~ $( ifTrue:[self halt. ^ name]. |
|
563 |
||
564 |
argSpec := self argSpecWithArgsFromStream:s in:aPackage. |
|
565 |
||
566 |
s next ~~ $) ifTrue:[self halt. ^ name]. |
|
567 |
||
568 |
retvalSpec := self retvalSpecFromStream:s in:aPackage. |
|
569 |
||
570 |
^ Array with:retvalSpec with:name with:argSpec |
|
571 |
||
572 |
" |
|
573 |
JavaMethod specWithArgsFromSignature:'(LObject;)V' withName:'foo' in:nil |
|
574 |
JavaMethod specComponentsWithArgsFromSignature:'(LObject;)V' withName:'foo' in:nil |
|
575 |
" |
|
576 |
||
577 |
"Created: 18.3.1997 / 11:06:22 / cg" |
|
578 |
"Modified: 1.8.1997 / 11:03:50 / cg" |
|
579 |
! |
|
580 |
||
581 |
specFromSignature:aSignature withName:name argNames:argNames in:aPackage |
|
582 |
"given a signature, return a spec" |
|
583 |
||
584 |
|s argSpec retvalSpec| |
|
585 |
||
586 |
s := aSignature readStream. |
|
587 |
s next ~~ $( ifTrue:[self halt. ^ name]. |
|
588 |
||
589 |
argSpec := self argSpecWithArgsFromStream:s in:aPackage argNames:argNames. |
|
590 |
||
591 |
s next ~~ $) ifTrue:[self halt. ^ name]. |
|
592 |
||
593 |
retvalSpec := self retvalSpecFromStream:s in:aPackage. |
|
594 |
||
595 |
^ retvalSpec , ' ' , name , ' (' , argSpec , ')' |
|
596 |
||
597 |
" |
|
598 |
JavaMethod specFromSignature:'(LObject;)V' withName:'foo' argNames:#('a') in:nil |
|
599 |
JavaMethod specFromSignature:'(BB)S' withName:'foo' argNames:#('a' 'b') in:nil |
|
600 |
" |
|
601 |
||
602 |
"Created: / 18.3.1997 / 11:06:22 / cg" |
|
603 |
"Modified: / 8.1.1998 / 21:14:43 / cg" |
|
604 |
! |
|
605 |
||
606 |
specFromSignature:aSignature withName:name in:aPackage |
|
607 |
"given a signature, return a spec" |
|
608 |
||
609 |
|s argSpec retvalSpec| |
|
610 |
||
611 |
s := aSignature readStream. |
|
612 |
s next ~~ $( ifTrue:[self halt. ^ name]. |
|
613 |
||
614 |
argSpec := self argSpecFromStream:s in:aPackage. |
|
615 |
||
616 |
s next ~~ $) ifTrue:[self halt. ^ name]. |
|
617 |
||
618 |
retvalSpec := self retvalSpecFromStream:s in:aPackage. |
|
619 |
||
620 |
^ retvalSpec , ' ' , name , ' (' , argSpec , ')' |
|
621 |
||
622 |
" |
|
623 |
JavaMethod specFromSignature:'(LObject;)V' withName:'foo' in:nil |
|
624 |
JavaMethod specFromSignature:'(BB)S' withName:'foo' in:nil |
|
625 |
" |
|
626 |
||
627 |
"Created: / 18.3.1997 / 11:06:22 / cg" |
|
628 |
"Modified: / 8.1.1998 / 21:06:32 / cg" |
|
629 |
! |
|
630 |
||
631 |
specTextFromSignature:aSignature in:aPackage withName:name |
|
632 |
"given a signature, return a spec as boldified text" |
|
633 |
||
634 |
|s argSpec retvalSpec| |
|
635 |
||
636 |
s := aSignature readStream. |
|
637 |
s next ~~ $( ifTrue:[self halt. ^ name]. |
|
638 |
||
639 |
argSpec := self argSpecFromStream:s in:aPackage. |
|
640 |
||
641 |
s next ~~ $) ifTrue:[self halt. ^ name]. |
|
642 |
||
643 |
retvalSpec := self retvalSpecFromStream:s in:aPackage. |
|
644 |
||
645 |
"/ ^ retvalSpec , ' ' , (name allBold) , ' (' , argSpec , ')' |
|
646 |
^ (name allBold) , ' (' , argSpec , ')' |
|
647 |
||
648 |
" |
|
649 |
JavaMethod specTextFromSignature:'(LObject;)V' withName:'foo' |
|
650 |
JavaMethod specTextFromSignature:'(BB)S' withName:'foo' |
|
651 |
" |
|
652 |
||
653 |
"Modified: / 8.1.1998 / 19:11:20 / cg" |
|
654 |
! |
|
655 |
||
656 |
specTextFromSignature:aSignature withName:name |
|
657 |
"given a signature, return a spec as boldified text" |
|
658 |
||
659 |
|s argSpec retvalSpec| |
|
660 |
||
661 |
s := aSignature readStream. |
|
662 |
s next ~~ $( ifTrue:[self halt. ^ name]. |
|
663 |
||
664 |
argSpec := self argSpecFromStream:s in:nil. |
|
665 |
||
666 |
s next ~~ $) ifTrue:[self halt. ^ name]. |
|
667 |
||
668 |
retvalSpec := self retvalSpecFromStream:s in:nil. |
|
669 |
||
670 |
^ retvalSpec , ' ' , (name allBold) , ' (' , argSpec , ')' |
|
671 |
||
672 |
" |
|
673 |
JavaMethod specTextFromSignature:'(LObject;)V' withName:'foo' |
|
674 |
JavaMethod specTextFromSignature:'(BB)S' withName:'foo' |
|
675 |
" |
|
676 |
||
677 |
"Modified: / 8.1.1998 / 19:11:20 / cg" |
|
678 |
! |
|
679 |
||
680 |
specTextWithArgsFromSignature:aSignature withName:name in:aPackage |
|
681 |
"given a signature, return a spec" |
|
682 |
||
683 |
|s argSpec retvalSpec| |
|
684 |
||
685 |
s := aSignature readStream. |
|
686 |
s next ~~ $( ifTrue:[self halt. ^ name]. |
|
687 |
||
688 |
argSpec := self argSpecWithArgsFromStream:s in:aPackage. |
|
689 |
||
690 |
s next ~~ $) ifTrue:[self halt. ^ name]. |
|
691 |
||
692 |
retvalSpec := self retvalSpecFromStream:s in:aPackage. |
|
693 |
||
694 |
^ retvalSpec , ' ' , (name allBold) , ' (' , argSpec , ')' |
|
695 |
||
696 |
" |
|
697 |
JavaMethod specWithArgsFromSignature:'(LObject;)V' withName:'foo' in:nil |
|
698 |
JavaMethod specWithArgsFromSignature:'(BB)S' withName:'foo' in:nil |
|
699 |
" |
|
700 |
||
701 |
"Modified: 20.3.1997 / 12:50:10 / cg" |
|
702 |
"Created: 1.8.1997 / 10:43:57 / cg" |
|
703 |
! |
|
704 |
||
705 |
specWithArgsFromSignature:aSignature withName:name in:aPackage |
|
706 |
"given a signature, return a spec" |
|
707 |
||
708 |
|s argSpec retvalSpec| |
|
709 |
||
710 |
s := aSignature readStream. |
|
711 |
s next ~~ $( ifTrue:[self halt. ^ name]. |
|
712 |
||
713 |
argSpec := self argSpecWithArgsFromStream:s in:aPackage. |
|
714 |
||
715 |
s next ~~ $) ifTrue:[self halt. ^ name]. |
|
716 |
||
717 |
retvalSpec := self retvalSpecFromStream:s in:aPackage. |
|
718 |
||
719 |
^ retvalSpec , ' ' , name , ' (' , argSpec , ')' |
|
720 |
||
721 |
" |
|
722 |
JavaMethod specWithArgsFromSignature:'(LObject;)V' withName:'foo' in:nil |
|
723 |
JavaMethod specWithArgsFromSignature:'(BB)S' withName:'foo' in:nil |
|
724 |
" |
|
725 |
||
726 |
"Created: 18.3.1997 / 11:06:22 / cg" |
|
727 |
"Modified: 20.3.1997 / 12:50:10 / cg" |
|
728 |
! |
|
729 |
||
730 |
typeFromSignature:aSignature in:package |
|
731 |
"given a signature, return its type as a string" |
|
732 |
||
733 |
|s c| |
|
734 |
||
735 |
s := aSignature readStream. |
|
736 |
(c := s peek) ~~ $( ifTrue:[ |
|
923 | 737 |
c == $' ifTrue:[ |
738 |
s next. |
|
739 |
[s peek ~= $'] whileTrue:[s next]. |
|
740 |
s next. |
|
741 |
^ (self retvalSpecFromStream:s in:package) |
|
742 |
]. |
|
743 |
^ (self retvalSpecFromStream:s in:package) |
|
752 | 744 |
]. |
745 |
||
746 |
s next. |
|
747 |
self argSpecFromStream:s in:nil. |
|
748 |
s next ~~ $) ifTrue:[self halt. ^ nil]. |
|
749 |
||
750 |
^ (self retvalSpecFromStream:s in:package) |
|
751 |
||
752 |
" |
|
753 |
JavaMethod typeFromSignature:'(LObject;)Ljava/lang/Object' |
|
754 |
JavaMethod typeFromSignature:'(LObject;)Ljava/lang/Object' in:'java.lang' |
|
755 |
" |
|
756 |
||
757 |
"Created: / 1.8.1997 / 10:50:38 / cg" |
|
758 |
"Modified: / 8.1.1998 / 19:09:31 / cg" |
|
759 |
! ! |
|
760 |
||
919 | 761 |
!JavaMethod methodsFor:'* As yet uncategorized *'! |
762 |
||
1384
d62dd4b29c22
Fixes in INSTANCE_OF + added missing method. SAXON-B now works again
vranyj1
parents:
1383
diff
changeset
|
763 |
annotationIndexOf:aSymbol |
d62dd4b29c22
Fixes in INSTANCE_OF + added missing method. SAXON-B now works again
vranyj1
parents:
1383
diff
changeset
|
764 |
|
d62dd4b29c22
Fixes in INSTANCE_OF + added missing method. SAXON-B now works again
vranyj1
parents:
1383
diff
changeset
|
765 |
^nil |
d62dd4b29c22
Fixes in INSTANCE_OF + added missing method. SAXON-B now works again
vranyj1
parents:
1383
diff
changeset
|
766 |
|
d62dd4b29c22
Fixes in INSTANCE_OF + added missing method. SAXON-B now works again
vranyj1
parents:
1383
diff
changeset
|
767 |
"Created: / 24-02-2012 / 16:06:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
d62dd4b29c22
Fixes in INSTANCE_OF + added missing method. SAXON-B now works again
vranyj1
parents:
1383
diff
changeset
|
768 |
! |
d62dd4b29c22
Fixes in INSTANCE_OF + added missing method. SAXON-B now works again
vranyj1
parents:
1383
diff
changeset
|
769 |
|
919 | 770 |
sends:symbol1 or:symbol2 |
771 |
||
772 |
^false |
|
1204 | 773 |
! |
774 |
||
775 |
sendsAny: selectors |
|
776 |
||
777 |
^false |
|
778 |
||
779 |
"Created: / 02-12-2011 / 23:05:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
919 | 780 |
! ! |
781 |
||
752 | 782 |
!JavaMethod methodsFor:'accessing'! |
783 |
||
784 |
accessFlags |
|
785 |
"java calls this the modifiers" |
|
786 |
||
787 |
^ accessFlags |
|
788 |
||
789 |
"Created: / 9.4.1998 / 17:49:44 / cg" |
|
790 |
! |
|
791 |
||
792 |
annotations |
|
793 |
^ annotations ifNil:[JavaMethodAnnotationContainer empty]. |
|
794 |
||
795 |
"Modified: / 03-03-2011 / 23:51:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
796 |
! |
|
797 |
||
798 |
annotations:something |
|
799 |
annotations := something. |
|
800 |
! |
|
801 |
||
802 |
argSignature |
|
913 | 803 |
^ self class argSigArrayFromSignature:descriptor |
752 | 804 |
! |
805 |
||
872 | 806 |
asByteCodeMethod |
807 |
||
808 |
"JavaMethods are always bytecode methods" |
|
809 |
||
810 |
^self |
|
811 |
||
812 |
"Created: / 18-07-2011 / 20:48:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
813 |
! |
|
814 |
||
752 | 815 |
comment |
816 |
"should access the source here, and parse any method comment" |
|
817 |
||
818 |
^ nil |
|
819 |
! |
|
820 |
||
821 |
constantPool |
|
822 |
^ javaClass constantPool |
|
823 |
||
824 |
"Modified: 16.4.1996 / 12:36:27 / cg" |
|
825 |
"Created: 16.4.1996 / 15:28:50 / cg" |
|
826 |
! |
|
827 |
||
828 |
containingClass |
|
829 |
^ javaClass |
|
830 |
||
831 |
! |
|
832 |
||
833 |
decompiledBytecode |
|
834 |
|s| |
|
835 |
||
836 |
s := '' writeStream. |
|
837 |
JavaDecompiler decompile:self to:s. |
|
838 |
^ s contents |
|
839 |
||
840 |
"Created: 7.4.1997 / 20:10:37 / cg" |
|
841 |
! |
|
842 |
||
843 |
decompiledSource |
|
844 |
|s| |
|
845 |
||
846 |
s := '' writeStream. |
|
847 |
self decompileSourceTo:s. |
|
848 |
^ s contents |
|
849 |
||
850 |
"Modified: 30.7.1997 / 16:27:55 / cg" |
|
851 |
! |
|
852 |
||
853 |
descriptor |
|
854 |
||
1227 | 855 |
^ (JavaDescriptor fromString: descriptor) name: self name |
913 | 856 |
|
857 |
"Created: / 16-04-1996 / 11:34:29 / cg" |
|
1227 | 858 |
"Modified: / 06-12-2011 / 21:53:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
859 |
! |
|
860 |
||
861 |
descriptorSymbol |
|
862 |
||
863 |
^descriptor |
|
864 |
||
865 |
"Created: / 16-04-1996 / 11:34:29 / cg" |
|
866 |
"Created: / 06-12-2011 / 23:00:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
752 | 867 |
! |
868 |
||
869 |
ensureHasAnnotations |
|
870 |
annotations |
|
871 |
ifNil:[ annotations := JavaMethodAnnotationContainer for:self ]. |
|
872 |
^ annotations |
|
873 |
||
874 |
"Created: / 25-02-2011 / 16:02:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
875 |
"Modified: / 28-02-2011 / 16:33:00 / Marcel Hlopko <hlopik@gmail.com>" |
|
876 |
! |
|
877 |
||
878 |
exceptionHandlerTable |
|
879 |
^ nil |
|
880 |
||
881 |
"Created: / 16.10.1998 / 01:50:51 / cg" |
|
882 |
! |
|
883 |
||
884 |
exceptionTable |
|
885 |
^ nil |
|
886 |
||
887 |
"Created: / 16.10.1998 / 01:51:04 / cg" |
|
888 |
! |
|
889 |
||
890 |
firstInstructionLineNumber |
|
891 |
ForceByteCodeDisplay == true ifTrue:[ ^ 1]. |
|
892 |
lineNumberTable notNil ifTrue:[ ^ lineNumberTable at:2]. |
|
893 |
^ 0. |
|
894 |
||
895 |
"Created: / 17-12-2010 / 17:02:46 / Jan Kurs <kurs.jan@post.cz>" |
|
896 |
"Modified: / 08-01-2011 / 16:30:16 / Jan Kurs <kurs.jan@post.cz>" |
|
897 |
! |
|
898 |
||
899 |
getExceptionTable |
|
900 |
||
901 |
^ nil |
|
902 |
||
903 |
"Created: / 04-02-2011 / 23:07:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
904 |
! |
|
905 |
||
906 |
getSourcePosition |
|
907 |
^ 1 |
|
908 |
! |
|
909 |
||
910 |
hasLineNumberInformation |
|
911 |
^ lineNumberTable notNil |
|
912 |
||
913 |
"Created: 16.4.1996 / 12:34:04 / cg" |
|
914 |
"Modified: 16.4.1996 / 12:49:06 / cg" |
|
915 |
! |
|
916 |
||
917 |
javaByteCode |
|
918 |
"/ ^ javaByteCode |
|
919 |
^ byteCode |
|
920 |
||
921 |
"Created: 16.4.1996 / 14:55:44 / cg" |
|
922 |
"Modified: 1.8.1997 / 00:08:45 / cg" |
|
923 |
! |
|
924 |
||
925 |
javaClass |
|
926 |
^ javaClass |
|
927 |
||
928 |
"Modified: 16.4.1996 / 12:36:27 / cg" |
|
929 |
"Created: 16.4.1996 / 14:55:44 / cg" |
|
930 |
! |
|
931 |
||
841 | 932 |
javaExceptionTable |
933 |
^ nil |
|
934 |
||
935 |
"Created: / 04-06-2011 / 18:16:23 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
936 |
! |
|
937 |
||
752 | 938 |
javaNumArgs |
939 |
^ self argSignature size. |
|
940 |
||
941 |
"Created: / 14-03-2011 / 15:50:58 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
942 |
! |
|
943 |
||
944 |
lineNumber |
|
945 |
lineNumberTable isNil ifTrue:[^ nil]. |
|
946 |
^ lineNumberTable at:2 |
|
947 |
||
948 |
"Created: 16.4.1996 / 12:34:04 / cg" |
|
949 |
"Modified: 16.4.1996 / 12:49:06 / cg" |
|
950 |
! |
|
951 |
||
952 |
lineNumberTable |
|
953 |
"/ lineNumberTable ifNil:[ lineNumberTable := Dictionary new.]. |
|
954 |
^ lineNumberTable |
|
955 |
||
956 |
"Created: / 16-04-1996 / 12:34:04 / cg" |
|
957 |
"Modified: / 13-12-2010 / 11:06:40 / Jan Kurs <kurs.jan@post.cz>" |
|
958 |
! |
|
959 |
||
960 |
literalsDetect:aBlock ifNone:exceptionBlock |
|
961 |
"execute a one arg block for each of our literals. |
|
962 |
return the first literal for which aBlock returns true" |
|
963 |
||
964 |
"/ sigh - must first extract all accessed literals ... |
|
965 |
"/ must deparse the byteCode in order to do this. |
|
966 |
||
967 |
|walker| |
|
968 |
||
969 |
walker := JavaByteCodeEnumerator new. |
|
970 |
walker literalAction:[:pc :slotIndex :const | |
|
971 |
const isJavaMethodRef ifTrue:[ |
|
972 |
(aBlock value:(const name)) ifTrue:[^ const name]. |
|
973 |
] ifFalse:[ |
|
974 |
const isJavaClassRef ifTrue:[ |
|
975 |
(aBlock value:(const name)) ifTrue:[^ const name]. |
|
976 |
] |
|
977 |
] |
|
978 |
]. |
|
979 |
walker decompile:self to:nil. |
|
980 |
^ nil |
|
981 |
||
982 |
"Created: / 9.11.1999 / 15:21:40 / cg" |
|
983 |
"Modified: / 24.12.1999 / 02:55:55 / cg" |
|
984 |
! |
|
985 |
||
986 |
localVariableTable |
|
987 |
^ localVariableTable |
|
988 |
||
989 |
" |
|
990 |
JavaMethod allInstancesDo:[:m| m localVariableTable notNil ifTrue:[self halt]] |
|
991 |
" |
|
992 |
! |
|
993 |
||
872 | 994 |
mclass |
995 |
^ self javaClass |
|
996 |
! |
|
997 |
||
998 |
mclass: anObject |
|
999 |
||
1000 |
javaClass := anObject |
|
1001 |
||
1002 |
"Created: / 18-10-2010 / 19:01:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1003 |
! |
|
1004 |
||
752 | 1005 |
methodArgAndVarNames |
1006 |
^ "((1 to:self numArgs) collect:[:i | 'arg' , i printString])" |
|
1007 |
self methodArgNames |
|
1008 |
, |
|
1009 |
"((1 to:self numVars) collect:[:i | 'local' , i printString])" |
|
1010 |
self methodVarNames |
|
1011 |
||
1012 |
"Modified: / 23-11-2010 / 19:32:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1013 |
! |
|
1014 |
||
1015 |
methodArgNames |
|
1016 |
|nA| |
|
1017 |
||
1018 |
nA := self numArgs. |
|
1019 |
localVariableTable notNil ifTrue:[ |
|
1020 |
^ (1 to:nA) collect: |
|
1021 |
[:argIndex | |
|
1022 |
|slot name| |
|
1023 |
"/ search for an entry with that index (slot), |
|
1024 |
"/ which has is valid at PC 0 |
|
1025 |
||
1026 |
self isStatic ifTrue:[ |
|
1027 |
slot := argIndex - 1 |
|
1028 |
] ifFalse:[ |
|
1029 |
slot := argIndex "/+ 1 |
|
1030 |
]. |
|
1031 |
name := localVariableTable nameForSlot:slot atPC:0. |
|
1032 |
name isNil ifTrue:[ |
|
1033 |
'arg' , argIndex printString |
|
1034 |
] ifFalse:[ |
|
1035 |
name |
|
1036 |
]. |
|
1037 |
] |
|
1038 |
]. |
|
1039 |
^ (1 to:nA) collect:[:i | 'arg' , i printString] |
|
1040 |
||
1041 |
"Modified: / 23-11-2010 / 19:47:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1042 |
! |
|
1043 |
||
1044 |
methodVarNames |
|
1045 |
|nV| |
|
1046 |
||
1047 |
nV := self numVars. |
|
1048 |
localVariableTable notNil ifTrue:[ |
|
1049 |
^ (self numArgs + 1 to: self numArgs + nV) collect: |
|
1050 |
[:argIndex | |
|
1051 |
|slot name| |
|
1052 |
"/ search for an entry with that index (slot), |
|
1053 |
"/ which has is valid at PC 0 |
|
1054 |
||
1055 |
self isStatic ifTrue:[ |
|
1056 |
slot := argIndex - 1 |
|
1057 |
] ifFalse:[ |
|
1058 |
slot := argIndex"/ + 1 |
|
1059 |
]. |
|
1060 |
name := localVariableTable nameForSlot:slot atPC:0. |
|
1061 |
name isNil ifTrue:[ |
|
1062 |
'local' , argIndex printString |
|
1063 |
] ifFalse:[ |
|
1064 |
name |
|
1065 |
]. |
|
1066 |
] |
|
1067 |
]. |
|
1068 |
^ (1 to:nV) collect:[:i | 'local' , i printString] |
|
1069 |
||
1070 |
"Created: / 23-11-2010 / 19:28:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1071 |
! |
|
1072 |
||
1073 |
name |
|
913 | 1074 |
^ (selector copyWithoutLast:descriptor size) asSymbol |
752 | 1075 |
|
1076 |
"Created: 16.4.1996 / 11:34:22 / cg" |
|
1077 |
! |
|
1078 |
||
872 | 1079 |
nameSpaceName |
1080 |
||
1081 |
^'' |
|
1082 |
||
1083 |
"Created: / 18-10-2010 / 19:10:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1084 |
! |
|
1085 |
||
1049 | 1086 |
numJArgs |
1087 |
||
1088 |
^self numberOfJavaArgs |
|
1089 |
||
1090 |
"Created: / 25-10-2011 / 10:50:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1091 |
! |
|
1092 |
||
1093 |
numJavaArgs |
|
1094 |
||
1095 |
^self numberOfJavaArgs |
|
1096 |
||
1097 |
"Created: / 25-10-2011 / 10:50:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1098 |
! |
|
1099 |
||
752 | 1100 |
numLocals |
1101 |
^super numVars. |
|
1102 |
"/ numLocals isNil ifTrue:[^ 0]. |
|
1103 |
"/ ^ numLocals |
|
1104 |
||
1105 |
"Modified: / 3.1.1998 / 21:15:38 / cg" |
|
1106 |
! |
|
1107 |
||
1108 |
numVars |
|
1109 |
|n| |
|
1110 |
||
1111 |
"/ a Java-stackframe includes the args in the locals |
|
1112 |
n := self numLocals - self numArgs. |
|
1113 |
^ n |
|
1114 |
||
1115 |
"Modified: / 13.1.1998 / 17:34:37 / cg" |
|
1116 |
! |
|
1117 |
||
1049 | 1118 |
numberOfJavaArgs |
1119 |
||
1051 | 1120 |
^(accessFlags bitAnd: 16r00FF0000) rightShift: 16. |
1049 | 1121 |
|
1122 |
"Created: / 25-10-2011 / 10:45:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1123 |
! |
|
1124 |
||
1125 |
numberOfJavaArgs: nArgs |
|
1126 |
||
1127 |
( nArgs > 16rFF ) ifTrue:[ |
|
1128 |
ArgumentError raiseRequestWith:self errorString:'too many args method - ', nArgs printString. |
|
1129 |
]. |
|
1130 |
||
1051 | 1131 |
accessFlags := accessFlags bitOr: |
1049 | 1132 |
((nArgs bitAnd: 16rFF) bitShift: 16) |
1133 |
||
1134 |
"Created: / 25-10-2011 / 10:43:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1135 |
! |
|
1136 |
||
923 | 1137 |
originalMethodIfWrapped |
1138 |
"return the method the receiver is wrapping - none here" |
|
1139 |
||
1140 |
^ self |
|
1141 |
||
1142 |
"Created: / 22-10-2010 / 11:46:07 / cg" |
|
1143 |
! |
|
1144 |
||
752 | 1145 |
previousVersion |
1146 |
^ nil |
|
1147 |
||
1148 |
"Created: 30.7.1997 / 15:56:18 / cg" |
|
1149 |
! |
|
1150 |
||
872 | 1151 |
previousVersionCode |
1152 |
||
1153 |
^nil |
|
1154 |
||
1155 |
"Created: / 18-10-2010 / 20:15:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1156 |
! |
|
1157 |
||
752 | 1158 |
retValSignature |
913 | 1159 |
^ self class retValSpecFromSignature:descriptor in:nil |
752 | 1160 |
|
1161 |
"Modified: / 8.1.1998 / 19:06:40 / cg" |
|
1162 |
! |
|
1163 |
||
1164 |
returnType |
|
1165 |
"/ ^ returnType |
|
913 | 1166 |
^ self class typeFromSignature:descriptor in:nil. |
752 | 1167 |
|
1168 |
"Modified: / 16.10.1998 / 00:17:43 / cg" |
|
1169 |
! |
|
1170 |
||
1171 |
returnTypeClass |
|
1172 |
|cls returnType| |
|
1173 |
||
1174 |
(returnType := self returnType) isNil ifTrue:[ |
|
923 | 1175 |
self halt. |
752 | 1176 |
]. |
1177 |
cls := Java at:returnType. |
|
1178 |
cls notNil ifTrue:[^ cls]. |
|
1179 |
||
1180 |
returnType == #void ifTrue:[ |
|
923 | 1181 |
^ nil |
752 | 1182 |
]. |
1183 |
returnType == #double ifTrue:[ |
|
923 | 1184 |
'warning: no returnTypeClass for double' printCR. |
752 | 1185 |
"/ self halt:'no returnTypeClass for double'. |
923 | 1186 |
^ nil |
752 | 1187 |
]. |
1188 |
returnType == #float ifTrue:[ |
|
923 | 1189 |
'warning: no returnTypeClass for float' printCR. |
752 | 1190 |
"/ self halt:'no returnTypeClass for float'. |
923 | 1191 |
^ nil |
752 | 1192 |
]. |
1193 |
returnType == #long ifTrue:[ |
|
923 | 1194 |
'warning: no returnTypeClass for long' printCR. |
752 | 1195 |
"/ self halt:'no returnTypeClass for long'. |
923 | 1196 |
^ nil |
752 | 1197 |
]. |
1198 |
returnType == #int ifTrue:[ |
|
923 | 1199 |
'warning: no returnTypeClass for int' printCR. |
752 | 1200 |
"/ self halt:'no returnTypeClass for int'. |
923 | 1201 |
^ nil |
752 | 1202 |
]. |
1203 |
returnType == #boolean ifTrue:[ |
|
923 | 1204 |
'warning: no returnTypeClass for boolean' printCR. |
752 | 1205 |
"/ self halt:'no returnTypeClass for boolean'. |
923 | 1206 |
^ nil |
752 | 1207 |
]. |
1208 |
self halt. |
|
1209 |
^ nil |
|
1210 |
||
1211 |
"Created: / 13.2.1998 / 15:08:26 / cg" |
|
1212 |
"Modified: / 16.10.1998 / 00:16:07 / cg" |
|
1213 |
! |
|
1214 |
||
1215 |
returnsDouble |
|
1216 |
^ self returnType == #double |
|
1217 |
||
1218 |
"Modified: / 16.10.1998 / 00:18:24 / cg" |
|
1219 |
! |
|
1220 |
||
1221 |
returnsLong |
|
1222 |
^ self returnType == #long |
|
1223 |
||
1224 |
"Modified: / 16.10.1998 / 00:18:41 / cg" |
|
1225 |
! |
|
1226 |
||
1227 |
returnsVoid |
|
1228 |
^ self returnType == #void |
|
1229 |
||
1230 |
"Modified: / 16-10-1998 / 00:18:53 / cg" |
|
1231 |
"Modified: / 22-03-2011 / 12:27:02 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1232 |
! |
|
1233 |
||
1234 |
selector |
|
1235 |
"/ could theoretically be extracted from my classes |
|
1236 |
"/ methodDictionary via: |
|
1237 |
"/ ^ javaClass methodDictionary keyAtValue:self ifAbsent:nil. |
|
1238 |
||
1239 |
^ selector |
|
1240 |
||
1241 |
"Created: / 7.1.1998 / 14:05:11 / cg" |
|
1242 |
"Modified: / 16.10.1998 / 13:41:06 / cg" |
|
1243 |
! |
|
1244 |
||
1245 |
signature |
|
1213
fc90769151e8
- fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents:
1204
diff
changeset
|
1246 |
^ signature |
fc90769151e8
- fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents:
1204
diff
changeset
|
1247 |
|
fc90769151e8
- fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents:
1204
diff
changeset
|
1248 |
"Modified: / 04-12-2011 / 19:39:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
752 | 1249 |
! |
1250 |
||
1251 |
source |
|
1252 |
| classSource | |
|
1253 |
"/ self isNative ifTrue:[ |
|
1254 |
"/ ^ 'native method' |
|
1255 |
"/ ]. |
|
1256 |
ForceByteCodeDisplay == true ifTrue:[ |
|
1257 |
^ self decompiledBytecode |
|
1258 |
]. |
|
1365 | 1259 |
"/ lineNumberTable notNil ifTrue:[ |
752 | 1260 |
classSource := javaClass source. |
1261 |
classSource notNil ifTrue:[ ^ classSource]. |
|
1365 | 1262 |
"/ ]. |
752 | 1263 |
^ self decompiledSource |
1264 |
||
1265 |
"Modified: / 04-01-1998 / 13:48:35 / cg" |
|
1266 |
"Modified: / 13-12-2010 / 11:06:51 / Jan Kurs <kurs.jan@post.cz>" |
|
1365 | 1267 |
"Modified: / 15-02-2012 / 00:01:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
752 | 1268 |
! |
1269 |
||
1270 |
sourceFilename |
|
1271 |
^ javaClass sourceFile |
|
1272 |
! |
|
1273 |
||
1274 |
sourceLineNumber |
|
1213
fc90769151e8
- fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents:
1204
diff
changeset
|
1275 |
|
752 | 1276 |
sourceLineNumber ifNil: [ |
1277 |
sourceLineNumber := (JavaSourceCodeCache new) |
|
1278 |
findLineForMethod: self |
|
1279 |
inClass:javaClass. |
|
1280 |
]. |
|
1213
fc90769151e8
- fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents:
1204
diff
changeset
|
1281 |
|
fc90769151e8
- fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents:
1204
diff
changeset
|
1282 |
"/sourceLineNumber := 0. |
752 | 1283 |
|
1284 |
sourceLineNumber == 0 ifTrue: |
|
1285 |
[ |
|
1286 |
"There is something wrong with parsing" |
|
1287 |
"/ self halt. |
|
1288 |
self breakPoint: #libjava. |
|
1289 |
sourceLineNumber := self firstInstructionLineNumber -2. |
|
1290 |
]. |
|
1291 |
||
1292 |
^ sourceLineNumber. |
|
1293 |
||
1294 |
"Created: / 30-07-1997 / 15:40:45 / cg" |
|
1295 |
"Modified: / 13-12-2010 / 23:46:30 / Marcel Hlopko <hlopik@gmail.com>" |
|
1296 |
"Modified: / 08-01-2011 / 16:20:40 / Jan Kurs <kurs.jan@post.cz>" |
|
1213
fc90769151e8
- fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents:
1204
diff
changeset
|
1297 |
"Modified: / 04-12-2011 / 18:25:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
872 | 1298 |
! |
1299 |
||
1300 |
wrapper |
|
1301 |
||
1302 |
^nil |
|
1303 |
||
1304 |
"Created: / 18-10-2010 / 19:11:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
752 | 1305 |
! ! |
1306 |
||
1307 |
!JavaMethod methodsFor:'compiler interface'! |
|
1308 |
||
1381 | 1309 |
mcompile |
1310 |
"__mcompile(OBJ aMethod, unsigned char *bytecode, int nBytes, int nArgs, OBJ receiver, OBJ selector, OBJ srchClass, OBJ *pArgsOrNull)" |
|
1311 |
||
1312 |
| bytecode nBytes nArgs receiver mySelector srchClass pArgsOrNull retVal | |
|
1313 |
bytecode := self byteCode. |
|
1314 |
nBytes := self byteCode size. |
|
1315 |
nArgs := self numArgs. |
|
1316 |
receiver := nil. |
|
1317 |
mySelector := self selector. |
|
1318 |
srchClass := self mclass. |
|
1319 |
||
1320 |
%{ |
|
1321 |
retVal = __mcompile(self, __ByteArrayInstPtr(bytecode), __intVal(nBytes), __intVal(nArgs), receiver, mySelector, srchClass, pArgsOrNull); |
|
1322 |
||
1323 |
||
1324 |
%}. |
|
1325 |
self halt. |
|
1326 |
||
1327 |
"Created: / 24-02-2012 / 11:39:13 / m" |
|
1328 |
"Modified: / 24-02-2012 / 14:00:04 / Marcel Hlopko <hlopik@gmail.com>" |
|
1329 |
! |
|
1330 |
||
752 | 1331 |
programmingLanguage |
1368 | 1332 |
"Returns a programming language of the method" |
1333 |
||
1334 |
"Do not return JavaLanguage unconditionally here. |
|
1335 |
Consider another JVM-based languages (such as Groovy)" |
|
1336 |
^javaClass programmingLanguage |
|
1337 |
||
752 | 1338 |
"Created: / 26-10-2010 / 23:42:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1339 |
! ! |
|
1340 |
||
1341 |
!JavaMethod methodsFor:'debugging'! |
|
1342 |
||
1343 |
breakPoint |
|
1344 |
Debugger enter:thisContext sender withMessage:'breakpoint' |
|
1345 |
||
1346 |
"Modified: / 9.1.1998 / 23:01:17 / cg" |
|
1347 |
! |
|
1348 |
||
1349 |
clearBreakPoint |
|
1114 | 1350 |
|
1351 |
accessFlags := (accessFlags bitClear:A_BREAKPOINT). |
|
752 | 1352 |
self hasCode ifTrue:[ |
923 | 1353 |
MessageTracer unwrapMethod:self |
1114 | 1354 |
] ifFalse:[ |
1355 |
Smalltalk changed:#methodTrap with:{ javaClass . selector } |
|
1356 |
] |
|
1357 |
||
1358 |
"Modified: / 13-11-1998 / 23:31:00 / cg" |
|
1359 |
"Modified: / 15-11-2011 / 22:44:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
752 | 1360 |
! |
1361 |
||
1362 |
isCounting |
|
1363 |
^ false. |
|
1364 |
||
1365 |
"Created: / 12.1.1998 / 20:02:23 / cg" |
|
1366 |
! |
|
1367 |
||
1368 |
isCountingMemoryUsage |
|
1369 |
^ false. |
|
1370 |
||
1371 |
"Created: / 12.1.1998 / 20:03:22 / cg" |
|
1372 |
! |
|
1373 |
||
1374 |
setBreakPoint |
|
1114 | 1375 |
|
1376 |
accessFlags := (accessFlags bitOr:A_BREAKPOINT). |
|
752 | 1377 |
self hasCode ifTrue:[ |
923 | 1378 |
MessageTracer trapMethod:self |
1114 | 1379 |
] ifFalse:[ |
1380 |
Smalltalk changed:#methodTrap with:{ javaClass . selector } |
|
752 | 1381 |
]. |
1114 | 1382 |
|
1383 |
"Modified: / 13-11-1998 / 23:30:45 / cg" |
|
1384 |
"Modified: / 15-11-2011 / 22:43:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
752 | 1385 |
! |
1386 |
||
1387 |
setTraceFullPoint |
|
1388 |
"not yet implemented" |
|
1389 |
||
1390 |
"Modified: / 9.1.1998 / 23:01:17 / cg" |
|
1391 |
"Created: / 12.1.1998 / 20:04:45 / cg" |
|
1392 |
! |
|
1393 |
||
1394 |
setTracePoint |
|
1395 |
"not yet implemented" |
|
1396 |
||
1397 |
"Modified: / 9.1.1998 / 23:01:17 / cg" |
|
1398 |
"Created: / 12.1.1998 / 20:04:02 / cg" |
|
1399 |
! |
|
1400 |
||
1401 |
setTraceSenderPoint |
|
1402 |
"not yet implemented" |
|
1403 |
||
1404 |
"Modified: / 9.1.1998 / 23:01:17 / cg" |
|
1405 |
"Created: / 12.1.1998 / 20:04:35 / cg" |
|
1406 |
! |
|
1407 |
||
1408 |
startCounting |
|
1409 |
"not yet implemented" |
|
1410 |
||
1411 |
"Modified: / 9.1.1998 / 23:01:17 / cg" |
|
1412 |
"Created: / 12.1.1998 / 20:05:01 / cg" |
|
1413 |
! |
|
1414 |
||
1415 |
startCountingMemoryUsage |
|
1416 |
"not yet implemented" |
|
1417 |
||
1418 |
"Modified: / 9.1.1998 / 23:01:17 / cg" |
|
1419 |
"Created: / 12.1.1998 / 20:05:04 / cg" |
|
1420 |
! |
|
1421 |
||
1422 |
startTiming |
|
1423 |
"not yet implemented" |
|
1424 |
||
1425 |
"Modified: / 9.1.1998 / 23:01:17 / cg" |
|
1426 |
"Created: / 12.1.1998 / 20:04:57 / cg" |
|
1427 |
! ! |
|
1428 |
||
1429 |
!JavaMethod methodsFor:'decompiling'! |
|
1430 |
||
1431 |
decompileSourceTo:aStream |
|
1432 |
|argNames| |
|
1433 |
||
1434 |
byteCode isNil ifTrue:[ |
|
1435 |
self isPublic ifTrue:[ |
|
1436 |
aStream nextPutAll:'public '. |
|
1437 |
]. |
|
1438 |
self isProtected ifTrue:[ |
|
1439 |
aStream nextPutAll:'protected '. |
|
1440 |
]. |
|
1441 |
self isPrivate ifTrue:[ |
|
1442 |
aStream nextPutAll:'private '. |
|
1443 |
]. |
|
1444 |
self isStatic ifTrue:[ |
|
1445 |
aStream nextPutAll:'static '. |
|
1446 |
]. |
|
1447 |
||
1448 |
self isNative ifTrue:[ |
|
1449 |
aStream nextPutAll:'native '. |
|
1450 |
]. |
|
1451 |
self isAbstract ifTrue:[ |
|
1452 |
aStream nextPutAll:'abstract '. |
|
1453 |
]. |
|
1454 |
argNames := #('arg1' 'arg2' 'arg3' 'arg4' 'arg5' 'arg6' 'arg7' 'arg8' 'arg9'). |
|
1455 |
aStream nextPutAll:(self signatureNameWithArgNames:argNames). |
|
1456 |
aStream nextPutAll:';'; cr. |
|
1457 |
^ self |
|
1458 |
]. |
|
1459 |
||
1460 |
" |
|
1461 |
JavaDeparser isNil ifTrue:[ |
|
1462 |
aStream nextPutAll:'// Sorry - no decompiler'. |
|
1463 |
^ self |
|
1464 |
]. |
|
1465 |
" |
|
1466 |
||
1467 |
||
1468 |
"/ self isNative ifFalse:[ |
|
1469 |
"/ self isAbstract ifFalse:[ |
|
1470 |
aStream nextPutAll:'// source not available...'; cr. |
|
1471 |
SignalSet anySignal handle:[:ex | |
|
1472 |
ex signal == Object haltSignal ifTrue:[ex reject]. |
|
1473 |
ex signal == MessageTracer breakpointSignal ifTrue:[ex reject]. |
|
1474 |
ex signal == Signal noHandlerSignal ifTrue:[ex reject]. |
|
1475 |
||
1476 |
aStream nextPutAll:'error while decompiling:'. |
|
1477 |
aStream cr; cr; spaces:4. |
|
1478 |
aStream nextPutAll:ex errorString. |
|
1479 |
aStream cr. |
|
1480 |
aStream nextPutAll:ex suspendedContext printString. |
|
1481 |
aStream cr. |
|
1482 |
aStream nextPutAll:ex suspendedContext sender printString. |
|
1483 |
aStream cr. |
|
1484 |
aStream nextPutAll:ex suspendedContext sender sender printString. |
|
1485 |
aStream cr. |
|
1486 |
aStream nextPutAll:ex suspendedContext sender sender sender printString. |
|
1487 |
aStream cr. |
|
1488 |
aStream nextPutAll:ex suspendedContext sender sender sender sender printString. |
|
1489 |
aStream cr. |
|
1490 |
aStream nextPutAll:ex suspendedContext sender sender sender sender sender printString. |
|
1491 |
aStream cr. |
|
1492 |
aStream nextPutAll:ex suspendedContext sender sender sender sender sender sender printString. |
|
1493 |
aStream cr. |
|
1494 |
aStream nextPutAll:ex suspendedContext sender sender sender sender sender sender sender printString. |
|
1495 |
aStream cr. |
|
1496 |
aStream nextPutAll:ex suspendedContext sender sender sender sender sender sender sender sender printString. |
|
1497 |
aStream cr. |
|
1498 |
||
1499 |
" |
|
1500 |
JavaByteCodeDisassembler isNil ifTrue:[ |
|
1501 |
aStream nextPutAll:'// Sorry - no decompiler' |
|
1502 |
] ifFalse:[ |
|
1503 |
JavaByteCodeDisassembler diassemble:self to:aStream. |
|
1504 |
]. |
|
1505 |
" |
|
1506 |
ex return |
|
1507 |
] do:[ |
|
1508 |
"aStream nextPutAll:(JavaDeparser decompile:self)." |
|
1509 |
JavaByteCodeDisassembler diassemble:self to:aStream. |
|
1510 |
]. |
|
1511 |
"/ ]. |
|
1512 |
"/ ]. |
|
1513 |
||
1514 |
"Created: / 30-07-1997 / 16:28:09 / cg" |
|
1515 |
"Modified: / 21-12-1999 / 14:31:54 / cg" |
|
1516 |
"Modified: / 22-03-2011 / 21:34:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1517 |
! |
|
1518 |
||
1519 |
decompiler |
|
1520 |
^ JavaDecompiler |
|
1521 |
||
1522 |
"Created: 30.7.1997 / 16:36:48 / cg" |
|
1523 |
! |
|
1524 |
||
1525 |
isMethod |
|
1526 |
"return true, if the receiver is some kind of method; |
|
1527 |
true returned here - the method is redefined from Object." |
|
1528 |
||
1529 |
^ true |
|
1530 |
||
1531 |
"Created: / 13.11.1998 / 23:57:40 / cg" |
|
1532 |
! |
|
1533 |
||
1534 |
originalMethod |
|
1535 |
^ self |
|
1536 |
||
1537 |
"Created: / 13.1.1998 / 15:03:05 / cg" |
|
1538 |
! ! |
|
1539 |
||
1540 |
!JavaMethod methodsFor:'error handling'! |
|
1541 |
||
872 | 1542 |
errorInvalidClassRefAt: index |
1543 |
||
1544 |
"Sent by the VM when an invalid entry in contant pool |
|
1545 |
is encountered - for instance when the VM expects |
|
1546 |
a classref but the entry is not a classref" |
|
1547 |
||
1548 |
" |
|
1549 |
javaClass constantPool at: index. |
|
1550 |
" |
|
1551 |
||
1552 |
JavaInvalidRefError new |
|
1553 |
javaClass: javaClass; |
|
1554 |
index: index; |
|
1555 |
raiseRequest |
|
1556 |
||
1557 |
"Created: / 18-07-2011 / 23:33:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1558 |
! |
|
1559 |
||
1560 |
errorInvalidFieldRefAt: index |
|
1561 |
||
1562 |
"Sent by the VM when an invalid entry in contant pool |
|
1563 |
is encountered - for instance when the VM expects |
|
1564 |
a classref but the entry is not a classref" |
|
1565 |
||
1566 |
" |
|
1567 |
javaClass constantPool at: index. |
|
1568 |
" |
|
1569 |
||
1570 |
JavaInvalidRefError new |
|
1571 |
javaClass: javaClass; |
|
1572 |
index: index; |
|
1573 |
raiseRequest |
|
1574 |
||
1575 |
"Created: / 18-07-2011 / 23:33:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1576 |
! |
|
1577 |
||
1578 |
errorInvalidMethodRefAt: index |
|
1579 |
||
1580 |
"Sent by the VM when an invalid entry in contant pool |
|
1581 |
is encountered - for instance when the VM expects |
|
1582 |
a classref but the entry is not a classref" |
|
1583 |
||
1584 |
" |
|
1585 |
javaClass constantPool at: index. |
|
1586 |
" |
|
1587 |
||
1588 |
JavaInvalidRefError new |
|
1589 |
javaClass: javaClass; |
|
1590 |
index: index; |
|
1591 |
raiseRequest |
|
1592 |
||
1593 |
"Created: / 18-07-2011 / 19:59:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1594 |
! |
|
1595 |
||
752 | 1596 |
invalidByteCode |
1597 |
self isAbstract ifTrue:[ |
|
913 | 1598 |
^ AbstractMethodInvokationSignal raise. |
752 | 1599 |
]. |
913 | 1600 |
((self class numArgsFromSignature:descriptor) > self class maxNumberOfArguments) ifTrue:[ |
1601 |
^ self error:'method cannot be executed - too many args' |
|
752 | 1602 |
]. |
1603 |
^ super invalidByteCode |
|
1604 |
||
913 | 1605 |
"Created: / 27-01-1998 / 21:48:01 / cg" |
1606 |
"Modified: / 14-08-2011 / 19:29:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
752 | 1607 |
! |
1608 |
||
1609 |
invalidMethodRef |
|
1610 |
self halt. |
|
1611 |
^ nil. |
|
1612 |
||
1613 |
"Modified: / 27.1.1998 / 21:50:19 / cg" |
|
1614 |
"Created: / 16.10.1998 / 11:27:21 / cg" |
|
1615 |
! |
|
1616 |
||
1617 |
nullClassPointer |
|
1618 |
JavaVM throwClassNotFoundException |
|
985 | 1619 |
! |
1620 |
||
1621 |
wrongNumberOfArguments:numArgsGiven |
|
1622 |
"{ Pragma: +optSpace }" |
|
1623 |
||
1624 |
"this error is triggered by the VM, if a method is called with a wrong number |
|
1625 |
of arguments. |
|
1626 |
This only applies to #valueWithReceiverXXX and #perform:withArguments: - sends. |
|
1627 |
With a normal send, this error cannot happen." |
|
1628 |
||
1629 |
^ JavaVM |
|
1630 |
throwIllegalArgumentException:(' - %1 got %2 arg(s) where %3 expected' |
|
1631 |
bindWith:self class name |
|
1632 |
with:numArgsGiven |
|
1633 |
with:self numArgs) |
|
1634 |
||
1635 |
" |
|
1636 |
2 perform:#+ |
|
1637 |
" |
|
1638 |
||
1639 |
"Modified: / 01-08-1997 / 00:23:10 / cg" |
|
1640 |
"Created: / 07-09-2011 / 14:17:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
752 | 1641 |
! ! |
1642 |
||
913 | 1643 |
!JavaMethod methodsFor:'initialization'! |
1644 |
||
1353 | 1645 |
resolve |
1363
afc7bcfd02e4
JavaMethod>>resolve: reverted code overwritten by MH
vranyj1
parents:
1362
diff
changeset
|
1646 |
"Called by VM to resolve all references used by this method. When |
afc7bcfd02e4
JavaMethod>>resolve: reverted code overwritten by MH
vranyj1
parents:
1362
diff
changeset
|
1647 |
successful (i.e., all references has been successfully resolved, a |
afc7bcfd02e4
JavaMethod>>resolve: reverted code overwritten by MH
vranyj1
parents:
1362
diff
changeset
|
1648 |
A_RESOLVED flag is set (to prevent VM from subsequent calls |
afc7bcfd02e4
JavaMethod>>resolve: reverted code overwritten by MH
vranyj1
parents:
1362
diff
changeset
|
1649 |
to this method) |
afc7bcfd02e4
JavaMethod>>resolve: reverted code overwritten by MH
vranyj1
parents:
1362
diff
changeset
|
1650 |
|
afc7bcfd02e4
JavaMethod>>resolve: reverted code overwritten by MH
vranyj1
parents:
1362
diff
changeset
|
1651 |
Returns 1 if successfull, 0 if not (at least one reference |
afc7bcfd02e4
JavaMethod>>resolve: reverted code overwritten by MH
vranyj1
parents:
1362
diff
changeset
|
1652 |
could not been resolved) or -1 when some (unspecified) erorr |
1380 | 1653 |
occurs." |
1363
afc7bcfd02e4
JavaMethod>>resolve: reverted code overwritten by MH
vranyj1
parents:
1362
diff
changeset
|
1654 |
"Marcel, continue here!! And ALWAYS commit ALL the code!! Sigh" |
1380 | 1655 |
|
1656 |
JavaByteCodePreresolver preresolve: self. |
|
1657 |
accessFlags := accessFlags | A_RESOLVED. |
|
1658 |
||
1363
afc7bcfd02e4
JavaMethod>>resolve: reverted code overwritten by MH
vranyj1
parents:
1362
diff
changeset
|
1659 |
"/RETURN 1...OK, |
afc7bcfd02e4
JavaMethod>>resolve: reverted code overwritten by MH
vranyj1
parents:
1362
diff
changeset
|
1660 |
"/ 0...Something could not be resolved |
afc7bcfd02e4
JavaMethod>>resolve: reverted code overwritten by MH
vranyj1
parents:
1362
diff
changeset
|
1661 |
"/ -1...Some error |
1383 | 1662 |
self breakPoint:#mh. |
1380 | 1663 |
^ 1. |
1355 | 1664 |
|
1353 | 1665 |
"Created: / 09-02-2012 / 20:59:22 / mh <hlopik@gmail.com>" |
1363
afc7bcfd02e4
JavaMethod>>resolve: reverted code overwritten by MH
vranyj1
parents:
1362
diff
changeset
|
1666 |
"Modified: / 11-02-2012 / 13:46:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1380 | 1667 |
"Modified (format): / 23-02-2012 / 17:49:09 / Marcel Hlopko <hlopik@gmail.com>" |
1383 | 1668 |
"Modified: / 24-02-2012 / 14:46:10 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
1353 | 1669 |
! |
1670 |
||
913 | 1671 |
setAccessFlags:flags |
1672 |
accessFlags := flags. |
|
1673 |
||
1674 |
"Created: 16.4.1996 / 11:34:14 / cg" |
|
1675 |
! |
|
1676 |
||
1677 |
setCode:codeBytes maxStack:max_stack maxLocals:max_locals u1:unknown1 u2:unknown2 |
|
1678 |
"/ javaByteCode := codeBytes. |
|
1679 |
byteCode := codeBytes. |
|
1680 |
"/ numStack := max_stack. |
|
1681 |
"/ numLocals := max_locals. |
|
1682 |
super numberOfVars:max_locals. |
|
1683 |
super stackSize:max_stack. |
|
1684 |
||
1685 |
"/ self displayString printNL. |
|
1686 |
"/ ' nStack: ' print. numStack print. |
|
1687 |
"/ ' nLocal: ' print. numLocals print. |
|
1688 |
"/ ' u1: ' print. unknown1 print. |
|
1689 |
"/ ' u2: ' print. unknown2 printNL. |
|
1690 |
||
1691 |
"Modified: 1.8.1997 / 00:08:32 / cg" |
|
1692 |
! |
|
1693 |
||
1694 |
setDescriptor:aString |
|
1695 |
||
1696 |
descriptor := aString asSymbol. |
|
1697 |
||
1698 |
"Created: / 16-04-1996 / 11:34:29 / cg" |
|
1699 |
"Modified: / 16-10-1998 / 00:17:12 / cg" |
|
1700 |
"Modified: / 13-08-2011 / 01:21:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1701 |
"Created: / 14-08-2011 / 19:41:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1702 |
! |
|
1703 |
||
1704 |
setJavaClass:aJavaClass |
|
1705 |
javaClass := aJavaClass |
|
1706 |
||
1707 |
"Modified: 16.4.1996 / 12:36:27 / cg" |
|
1708 |
"Created: 16.4.1996 / 15:28:15 / cg" |
|
1709 |
! |
|
1710 |
||
1711 |
setLineNumberTable:anArrayOfPCtoLineAssociations |
|
1712 |
"since this uses up lots of memory, compress it" |
|
1713 |
||
1714 |
|allBytes allWords idx| |
|
1715 |
||
1716 |
allBytes := allWords := true. |
|
1717 |
||
1718 |
anArrayOfPCtoLineAssociations do:[:assoc | |
|
923 | 1719 |
assoc key > 255 ifTrue:[ |
1720 |
allBytes := false. |
|
1721 |
assoc key > 16rFFFF ifTrue:[ |
|
1722 |
allWords := false. |
|
1723 |
]. |
|
1724 |
]. |
|
1725 |
assoc value > 255 ifTrue:[ |
|
1726 |
allBytes := false. |
|
1727 |
assoc value > 16rFFFF ifTrue:[ |
|
1728 |
allWords := false |
|
1729 |
]. |
|
1730 |
]. |
|
913 | 1731 |
]. |
1732 |
allBytes ifTrue:[ |
|
923 | 1733 |
lineNumberTable := ByteArray new:(anArrayOfPCtoLineAssociations size * 2). |
913 | 1734 |
] ifFalse:[ |
923 | 1735 |
allWords ifTrue:[ |
1736 |
lineNumberTable := WordArray new:(anArrayOfPCtoLineAssociations size * 2). |
|
1737 |
] ifFalse:[ |
|
1738 |
lineNumberTable := Array new:(anArrayOfPCtoLineAssociations size * 2). |
|
1739 |
] |
|
913 | 1740 |
]. |
1741 |
||
1742 |
idx := 1. |
|
1743 |
anArrayOfPCtoLineAssociations do:[:assoc | |
|
923 | 1744 |
lineNumberTable at:idx put:assoc key. |
1745 |
lineNumberTable at:idx+1 put:assoc value. |
|
1746 |
idx := idx + 2. |
|
913 | 1747 |
]. |
1748 |
||
1749 |
"Created: 16.4.1996 / 12:34:04 / cg" |
|
1750 |
"Modified: 16.4.1996 / 12:49:06 / cg" |
|
1751 |
! |
|
1752 |
||
1753 |
setLocalVariableTable:anArray |
|
1754 |
localVariableTable := anArray. |
|
1755 |
! |
|
1756 |
||
1757 |
setName:nameString descriptor:aString |
|
1758 |
||
1759 |
||
1049 | 1760 |
|numArgs numJArgs returnType| |
913 | 1761 |
|
1762 |
selector := (nameString , aString) asSymbol. |
|
1763 |
self setDescriptor:aString. |
|
1764 |
||
1049 | 1765 |
numJArgs := self class numArgsFromSignature:aString. |
1766 |
(numJArgs > self class maxNumberOfArguments) ifTrue:[ |
|
1767 |
numArgs := 1. |
|
1768 |
] ifFalse:[ |
|
1769 |
numArgs := numJArgs. |
|
1770 |
]. |
|
1771 |
self numberOfArgs:numArgs. |
|
1772 |
self numberOfJavaArgs:numJArgs. |
|
1773 |
returnType := self class typeFromSignature:aString in:nil. |
|
913 | 1774 |
|
1775 |
"/ for the convenience of the VM, also mirror the return type in |
|
1776 |
"/ the flags ... |
|
1777 |
||
1778 |
returnType == #void ifTrue:[ |
|
1779 |
accessFlags := accessFlags bitOr:R_VOID |
|
1780 |
] ifFalse:[ |
|
1781 |
returnType == #long ifTrue:[ |
|
1782 |
accessFlags := accessFlags bitOr:R_LONG |
|
1783 |
] ifFalse:[ |
|
1784 |
returnType == #double ifTrue:[ |
|
1785 |
accessFlags := accessFlags bitOr:R_DOUBLE |
|
1786 |
] |
|
1787 |
] |
|
1788 |
]. |
|
1789 |
||
1790 |
"Created: / 14-08-2011 / 19:41:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1791 |
! |
|
1792 |
||
1793 |
setSignature:aString |
|
1794 |
||
1795 |
signature := aString asSymbol. |
|
1796 |
||
1797 |
"Created: / 16-04-1996 / 11:34:29 / cg" |
|
1798 |
"Modified: / 16-10-1998 / 00:17:12 / cg" |
|
1799 |
"Modified (format): / 14-08-2011 / 19:41:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1800 |
! ! |
|
1801 |
||
752 | 1802 |
!JavaMethod methodsFor:'inspecting'! |
1803 |
||
1804 |
inspectorExtraAttributes |
|
1805 |
"extra (pseudo instvar) entries to be shown in an inspector." |
|
1806 |
||
1807 |
^ Dictionary new |
|
1808 |
declareAllNewFrom:(super inspectorExtraAttributes ? #()); |
|
1809 |
"/add:'-code' -> [ String streamContents:[:s | JavaDecompiler decompile: self to: s] ]; |
|
1810 |
add:'-code' -> [ String streamContents:[:s | JavaByteCodeDisassembler diassemble: self to: s] ]; |
|
1811 |
"/add:'-source' -> [ self source ]; |
|
1812 |
yourself |
|
1813 |
||
1814 |
"Modified: / 22-03-2011 / 21:13:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1815 |
! ! |
|
1816 |
||
1817 |
!JavaMethod methodsFor:'interpretation'! |
|
1818 |
||
1819 |
interpretWithReceiver: receiver |
|
1820 |
||
1821 |
^self |
|
1822 |
interpretWithReceiver: receiver |
|
1823 |
arguments: #() |
|
1824 |
||
1825 |
"Created: / 24-02-2011 / 22:05:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1826 |
! |
|
1827 |
||
1828 |
interpretWithReceiver: receiver arg: a1 |
|
1829 |
||
1830 |
^self |
|
1831 |
interpretWithReceiver: receiver |
|
1832 |
arguments: (Array with: a1) |
|
1833 |
||
1834 |
"Created: / 24-02-2011 / 22:05:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1835 |
! |
|
1836 |
||
1837 |
interpretWithReceiver: receiver arg: a1 arg: a2 |
|
1838 |
||
1839 |
^self |
|
1840 |
interpretWithReceiver: receiver |
|
1841 |
arguments: (Array with: a1 with: a2) |
|
1842 |
||
1843 |
"Created: / 24-02-2011 / 22:05:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1844 |
! |
|
1845 |
||
1846 |
interpretWithReceiver: receiver arg: a1 arg: a2 arg: a3 |
|
1847 |
||
1848 |
^self |
|
1849 |
interpretWithReceiver: receiver |
|
1850 |
arguments: (Array with: a1 with: a2 with: a3) |
|
1851 |
||
1852 |
"Created: / 24-02-2011 / 22:06:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1853 |
! |
|
1854 |
||
1855 |
interpretWithReceiver: receiver arguments:args |
|
1856 |
||
1857 |
^ JavaByteCodeInterpreter |
|
1858 |
interpret:self |
|
1859 |
receiver:receiver |
|
1860 |
arguments:args |
|
1861 |
||
1862 |
"Modified: / 24-02-2011 / 23:00:42 / Marcel Hlopko <hlopik@gmail.com>" |
|
1863 |
"Created: / 24-02-2011 / 22:04:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1864 |
! ! |
|
1865 |
||
1866 |
!JavaMethod methodsFor:'methodref interchangability'! |
|
1867 |
||
1868 |
homeMethod |
|
1869 |
^ self |
|
1870 |
! |
|
1871 |
||
1872 |
method |
|
1873 |
^ self |
|
1874 |
! |
|
1875 |
||
1876 |
setPackage:newPackage |
|
1877 |
newPackage ~= javaClass package ifTrue:[ |
|
1878 |
self halt:'java method cannot be in a package different from its class'. |
|
1879 |
] |
|
1880 |
! ! |
|
1881 |
||
1882 |
!JavaMethod methodsFor:'misc'! |
|
1883 |
||
1884 |
fromMethod:aJavaMethod |
|
1885 |
"copy values from another javaMethod" |
|
1886 |
||
1887 |
flags := aJavaMethod flags. |
|
1888 |
byteCode := aJavaMethod byteCode. |
|
1889 |
accessFlags := aJavaMethod accessFlags. |
|
1890 |
selector := aJavaMethod selector. |
|
1891 |
javaClass := aJavaMethod javaClass. |
|
913 | 1892 |
descriptor := aJavaMethod instVarNamed:#descriptor. |
1893 |
signature := aJavaMethod instVarNamed:#signature. |
|
752 | 1894 |
lineNumberTable := aJavaMethod lineNumberTable. |
1895 |
localVariableTable := aJavaMethod localVariableTable. |
|
1896 |
annotations := aJavaMethod annotations. |
|
1897 |
||
1898 |
"Modified: / 16-10-1998 / 01:27:19 / cg" |
|
913 | 1899 |
"Modified: / 14-08-2011 / 19:30:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
752 | 1900 |
! |
1901 |
||
1902 |
updateClassRefsFrom:oldClass to:newClass |
|
1903 |
javaClass == oldClass ifTrue:[ |
|
923 | 1904 |
"/ invalidate |
1905 |
byteCode := nil. |
|
752 | 1906 |
] |
1907 |
||
1908 |
"Created: / 6.1.1998 / 18:19:48 / cg" |
|
1909 |
! ! |
|
1910 |
||
1911 |
!JavaMethod methodsFor:'printing & storing'! |
|
1912 |
||
1913 |
displayString |
|
1914 |
javaClass isNil ifTrue:[ |
|
1915 |
^ self class name , '(???)' |
|
1916 |
]. |
|
1917 |
^ self class name , '(' , javaClass displayString , '::' , self signatureName , ')' |
|
1918 |
||
1919 |
"Modified: / 25.9.1999 / 23:04:01 / cg" |
|
1920 |
! |
|
1921 |
||
1216 | 1922 |
printOn: aStream |
1923 |
||
1924 |
super printOn: aStream. |
|
1925 |
aStream nextPut: $(. |
|
1926 |
javaClass name printOn: aStream. |
|
1927 |
aStream nextPut: $.. |
|
1928 |
selector printOn: aStream. |
|
1929 |
aStream nextPut: $). |
|
1930 |
||
1931 |
"Created: / 05-12-2011 / 01:30:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1932 |
! |
|
1933 |
||
752 | 1934 |
printStringForBrowserWithSelector:dummySelector inClass:dummyClass |
1935 |
"/ self isStatic ifTrue:[ |
|
1936 |
"/ ^ 'static ' , self signatureName |
|
1937 |
"/ ]. |
|
1938 |
"/ self isBreakpointed ifTrue:[ |
|
1939 |
"/ ^ (LabelAndIcon '!! ' , self signatureName |
|
1940 |
"/ ]. |
|
1941 |
||
1942 |
self name = #'<init>' ifTrue:[ |
|
913 | 1943 |
^ self class specTextFromSignature:descriptor in:javaClass package withName:(javaClass lastName). |
752 | 1944 |
]. |
913 | 1945 |
^ self class specTextFromSignature:descriptor in:javaClass package withName:(self name) |
752 | 1946 |
! |
1947 |
||
1948 |
shortDisplayString |
|
1949 |
^ javaClass name , '::' , self signatureNameWithoutReturnType |
|
1950 |
! |
|
1951 |
||
1952 |
signatureName |
|
1953 |
"return a string to be used when browsing" |
|
1954 |
||
913 | 1955 |
^ self class specFromSignature:descriptor withName:(self name) in:nil |
752 | 1956 |
|
1957 |
"Modified: / 8.1.1998 / 19:15:33 / cg" |
|
1958 |
! |
|
1959 |
||
1960 |
signatureNameFor:name withArgsIn:aPackage |
|
1961 |
"return a string to be used when decompiling" |
|
1962 |
||
913 | 1963 |
^ self class specWithArgsFromSignature:descriptor withName:name in:aPackage |
752 | 1964 |
|
1965 |
"Created: 25.3.1997 / 18:49:45 / cg" |
|
1966 |
! |
|
1967 |
||
1968 |
signatureNameIn:aPackage |
|
1969 |
"return a string to be used when browsing" |
|
1970 |
||
913 | 1971 |
^ self class specFromSignature:descriptor withName:(self name) in:aPackage |
752 | 1972 |
|
1973 |
"Created: 18.3.1997 / 11:11:01 / cg" |
|
1974 |
! |
|
1975 |
||
1976 |
signatureNameText |
|
1977 |
"return a text to be used when browsing" |
|
1978 |
||
913 | 1979 |
^ self class specTextFromSignature:descriptor withName:(self name) |
752 | 1980 |
|
1981 |
"Created: 30.7.1997 / 14:40:29 / cg" |
|
1982 |
! |
|
1983 |
||
1984 |
signatureNameTextFor:name withArgsIn:aPackage |
|
1985 |
"return a text to be used when decompiling" |
|
1986 |
||
913 | 1987 |
^ self class specTextWithArgsFromSignature:descriptor withName:name in:aPackage |
752 | 1988 |
|
1989 |
"Created: 25.3.1997 / 18:49:45 / cg" |
|
1990 |
"Modified: 1.8.1997 / 10:44:28 / cg" |
|
1991 |
! |
|
1992 |
||
1993 |
signatureNameWithArgNames:argNames |
|
1994 |
"return a string to be used when browsing" |
|
1995 |
||
1996 |
|myName| |
|
1997 |
||
1998 |
myName := self name. |
|
1999 |
myName = '<init>' ifTrue:[ |
|
923 | 2000 |
myName := javaClass name |
752 | 2001 |
]. |
913 | 2002 |
^ self class specFromSignature:descriptor withName:myName argNames:argNames in:nil |
752 | 2003 |
|
2004 |
"Created: / 8.1.1998 / 21:04:03 / cg" |
|
2005 |
"Modified: / 8.1.1998 / 21:22:38 / cg" |
|
2006 |
! |
|
2007 |
||
2008 |
signatureNameWithArgNames:argNames in:package |
|
2009 |
"return a string to be used when browsing" |
|
2010 |
||
2011 |
|myName| |
|
2012 |
||
2013 |
myName := self name. |
|
2014 |
myName = '<init>' ifTrue:[ |
|
923 | 2015 |
myName := javaClass name |
752 | 2016 |
]. |
913 | 2017 |
^ self class specFromSignature:descriptor withName:myName argNames:argNames in:package |
752 | 2018 |
|
2019 |
"Modified: / 8.1.1998 / 21:05:52 / cg" |
|
2020 |
"Created: / 8.1.1998 / 21:23:03 / cg" |
|
2021 |
! |
|
2022 |
||
2023 |
signatureNameWithArgsIn:aPackage |
|
2024 |
"return a string to be used when browsing" |
|
2025 |
||
913 | 2026 |
^ self class specWithArgsFromSignature:descriptor withName:(self name) in:aPackage |
2027 |
||
2028 |
"Created: / 20-03-1997 / 12:44:17 / cg" |
|
2029 |
"Modified: / 14-08-2011 / 19:29:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
752 | 2030 |
! |
2031 |
||
2032 |
signatureNameWithModifiers |
|
2033 |
"return a string to be used when deassembling" |
|
2034 |
||
2035 |
| result | |
|
2036 |
||
2037 |
result := self signatureName. |
|
2038 |
self isFinal ifTrue: [ result := 'final ' , result ]. |
|
2039 |
self isStatic ifTrue: [ result := 'static ' , result ]. |
|
2040 |
self isSynchronized ifTrue: [ result := 'synchronized ' , result ]. |
|
2041 |
self isPrivate |
|
2042 |
ifTrue: [ result := 'private ' , result ] |
|
2043 |
ifFalse: |
|
2044 |
[ self isProtected |
|
2045 |
ifTrue: [ result := 'protected ' , result ] |
|
2046 |
ifFalse: [ self isPublic ifTrue: [ result := 'public ' , result ] ] ]. |
|
2047 |
self isAbstract ifTrue: [ result := 'abstract ' , result ]. |
|
2048 |
^ result. |
|
2049 |
||
2050 |
"Modified: / 08-01-1998 / 19:15:33 / cg" |
|
2051 |
"Created: / 22-03-2011 / 16:25:27 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2052 |
! |
|
2053 |
||
2054 |
signatureNameWithoutReturnType |
|
2055 |
"return a string to be used when browsing" |
|
2056 |
||
913 | 2057 |
^ self class argSpecFromSignature:descriptor withName:(self name) |
752 | 2058 |
|
2059 |
! ! |
|
2060 |
||
2061 |
!JavaMethod methodsFor:'queries'! |
|
2062 |
||
2063 |
handlerFor:anException at:pc |
|
2064 |
"return an exceptionHandlers pc, for an exception of the given type, |
|
2065 |
occurring at pc. Returns nil, if there is none." |
|
2066 |
||
2067 |
|handlerTable| |
|
2068 |
||
2069 |
(handlerTable := self exceptionHandlerTable) isNil ifTrue:[^ nil]. |
|
2070 |
||
2071 |
handlerTable do:[:entry | |
|
2072 |
|hpc| |
|
2073 |
||
2074 |
hpc := entry handlerPCFor:anException at:pc in:self. |
|
2075 |
hpc notNil ifTrue:[^ hpc]. |
|
2076 |
]. |
|
2077 |
||
2078 |
^ nil |
|
2079 |
||
2080 |
"Created: / 16.10.1998 / 01:18:40 / cg" |
|
2081 |
"Modified: / 25.9.1999 / 23:07:01 / cg" |
|
2082 |
! |
|
2083 |
||
872 | 2084 |
hasPrimitiveCode |
2085 |
||
2086 |
^false |
|
2087 |
||
2088 |
"Created: / 18-07-2011 / 20:45:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2089 |
! |
|
2090 |
||
752 | 2091 |
hasResource |
2092 |
^ false |
|
2093 |
! |
|
2094 |
||
2095 |
isAbstract |
|
2096 |
^ (accessFlags bitAnd:A_ABSTRACT) ~~ 0 |
|
2097 |
! |
|
2098 |
||
2099 |
isBreakpointed |
|
2100 |
^ (accessFlags bitAnd:A_BREAKPOINT) ~~ 0 |
|
2101 |
||
2102 |
"Modified: / 11.1.1998 / 13:28:43 / cg" |
|
2103 |
! |
|
2104 |
||
2105 |
isFinal |
|
2106 |
^ (accessFlags bitAnd:A_FINAL) ~~ 0 |
|
2107 |
! |
|
2108 |
||
2109 |
isIgnored |
|
2110 |
"not really a java attribute; |
|
2111 |
added to allow browsing" |
|
2112 |
||
2113 |
^ false. |
|
2114 |
||
2115 |
"Created: 30.7.1997 / 15:34:33 / cg" |
|
2116 |
! |
|
2117 |
||
2118 |
isJavaClassRef |
|
2119 |
^ false |
|
2120 |
||
2121 |
"Created: / 9.11.1999 / 17:16:20 / cg" |
|
2122 |
! |
|
2123 |
||
2124 |
isJavaMethod |
|
2125 |
^ true |
|
2126 |
||
2127 |
"Created: / 10.11.1998 / 18:24:51 / cg" |
|
2128 |
! |
|
2129 |
||
2130 |
isNative |
|
2131 |
^ (accessFlags bitAnd:A_NATIVE) ~~ 0 |
|
2132 |
! |
|
2133 |
||
2134 |
isPrivate |
|
2135 |
^ (accessFlags bitAnd:A_PRIVATE) ~~ 0 |
|
2136 |
! |
|
2137 |
||
2138 |
isProtected |
|
2139 |
^ (accessFlags bitAnd:A_PROTECTED) ~~ 0 |
|
2140 |
! |
|
2141 |
||
2142 |
isPublic |
|
2143 |
^ (accessFlags bitAnd:A_PUBLIC) ~~ 0 |
|
2144 |
! |
|
2145 |
||
2146 |
isStatic |
|
2147 |
^ (accessFlags bitAnd:A_STATIC) ~~ 0 |
|
2148 |
! |
|
2149 |
||
2150 |
isSynchronized |
|
2151 |
^ (accessFlags bitAnd:A_SYNCHRONIZED) ~~ 0 |
|
2152 |
! |
|
2153 |
||
2154 |
isTraced |
|
2155 |
^ false |
|
2156 |
||
2157 |
"Modified: / 11.1.1998 / 13:28:43 / cg" |
|
2158 |
"Created: / 11.1.1998 / 13:38:11 / cg" |
|
2159 |
! |
|
2160 |
||
2161 |
isUnloaded |
|
2162 |
^ false |
|
2163 |
! |
|
2164 |
||
2165 |
isUnresolved |
|
2166 |
"return true, if the receiver is unresolved;" |
|
2167 |
||
2168 |
||
2169 |
^ false |
|
2170 |
||
2171 |
"Created: / 06-03-2011 / 22:57:35 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2172 |
! |
|
2173 |
||
2174 |
isWrapped |
|
2175 |
^ self isBreakpointed |
|
2176 |
||
2177 |
"Modified: / 11.1.1998 / 13:28:43 / cg" |
|
2178 |
"Created: / 11.1.1998 / 13:38:04 / cg" |
|
2179 |
! |
|
2180 |
||
2181 |
lineNumberForPC:pc |
|
2182 |
|last num text classSource| |
|
2183 |
||
2184 |
num := nil. |
|
2185 |
||
2186 |
ForceByteCodeDisplay == true ifFalse:[ |
|
2187 |
||
923 | 2188 |
lineNumberTable notNil ifTrue:[ |
2189 |
classSource := javaClass source. |
|
2190 |
classSource notNil ifTrue:[ |
|
2191 |
lineNumberTable pairWiseDo:[:lPc :lNr | |
|
2192 |
lPc >= pc ifTrue:[ |
|
2193 |
lPc == pc ifTrue:[^ lNr]. |
|
2194 |
last isNil ifTrue:[^ lNr]. |
|
2195 |
^ last. |
|
2196 |
]. |
|
2197 |
last := lNr. |
|
2198 |
]. |
|
2199 |
last notNil ifTrue:[ |
|
2200 |
^ last |
|
2201 |
]. |
|
2202 |
^ lineNumberTable at:2 |
|
2203 |
]. |
|
2204 |
]. |
|
752 | 2205 |
]. |
2206 |
||
2207 |
"/ decompile and look which line the pc falls into |
|
2208 |
||
2209 |
ForceByteCodeDisplay == true ifTrue:[ |
|
923 | 2210 |
text := self decompiledBytecode asCollectionOfLines. |
752 | 2211 |
] ifFalse:[ |
923 | 2212 |
text := self decompiledSource asCollectionOfLines. |
752 | 2213 |
]. |
2214 |
||
2215 |
text keysAndValuesDo:[:lineNr :line | |
|
923 | 2216 |
|nr| |
2217 |
||
2218 |
(line startsWith:' ') ifFalse:[ |
|
2219 |
nr := Integer readFrom:line onError:0. |
|
2220 |
nr >= pc ifTrue:[ |
|
2221 |
^ lineNr |
|
2222 |
] |
|
2223 |
] |
|
752 | 2224 |
]. |
2225 |
^ num |
|
2226 |
||
2227 |
"Modified: / 14.1.1998 / 13:30:54 / cg" |
|
2228 |
! |
|
2229 |
||
2230 |
messagesSent |
|
2231 |
"return a collection of messages sent by this method" |
|
2232 |
||
2233 |
|walker selectors| |
|
2234 |
||
2235 |
"/ sigh - must extract all accessed literals ... |
|
2236 |
"/ must deparse the byteCode in order to do this. |
|
2237 |
||
2238 |
selectors := IdentitySet new. |
|
2239 |
walker := JavaByteCodeEnumerator new. |
|
2240 |
walker |
|
2241 |
literalAction: |
|
2242 |
[:pc :slotIndex :const | |
|
2243 |
|mSel| |
|
2244 |
||
2245 |
(const isNumber |
|
2246 |
or:[const isString |
|
2247 |
or:[const isNil]]) ifFalse:[ |
|
2248 |
const isJavaMethod ifTrue:[ |
|
2249 |
mSel := const selector. |
|
2250 |
] ifFalse:[ |
|
2251 |
const isJavaMethodRef ifTrue:[ |
|
2252 |
mSel := const selector "/ signature. |
|
2253 |
] |
|
2254 |
]. |
|
2255 |
]. |
|
2256 |
mSel notNil ifTrue:[ |
|
2257 |
"/ Transcript showCR:mSel. |
|
2258 |
selectors add:mSel |
|
2259 |
]. |
|
2260 |
]. |
|
2261 |
walker decompile:self to:nil. |
|
2262 |
^ selectors |
|
2263 |
! |
|
2264 |
||
2265 |
package |
|
2266 |
"in java, class extensions are not possible; |
|
2267 |
all methods MUST be in their classes package" |
|
2268 |
||
2269 |
^ javaClass package |
|
2270 |
! |
|
2271 |
||
2272 |
quickLineNumberForPC:pc |
|
2273 |
|last| |
|
2274 |
||
2275 |
lineNumberTable notNil ifTrue:[ |
|
923 | 2276 |
lineNumberTable pairWiseDo:[:lPc :lNr | |
2277 |
lPc >= pc ifTrue:[ |
|
2278 |
lPc == pc ifTrue:[^ lNr]. |
|
2279 |
last isNil ifTrue:[^ lNr]. |
|
2280 |
^ last. |
|
2281 |
]. |
|
2282 |
last := lNr. |
|
2283 |
]. |
|
2284 |
last notNil ifTrue:[ |
|
2285 |
^ last |
|
2286 |
]. |
|
2287 |
^ lineNumberTable at:2 |
|
752 | 2288 |
]. |
2289 |
^ nil |
|
2290 |
||
2291 |
"Modified: / 14.1.1998 / 13:30:54 / cg" |
|
2292 |
"Created: / 10.11.1998 / 14:18:22 / cg" |
|
2293 |
! |
|
2294 |
||
2295 |
referencesGlobal:aGlobalName |
|
2296 |
"return true, if this method refers to a global named aGlobalName" |
|
2297 |
||
2298 |
|walker any| |
|
2299 |
||
2300 |
"/ quick check, if constantPool includes a methodRef for this |
|
2301 |
"/ selector. |
|
2302 |
||
2303 |
any := false. |
|
2304 |
self javaClass constantPool do:[:const | |
|
2305 |
(const isNumber |
|
2306 |
or:[const isString |
|
2307 |
or:[const isNil]]) ifFalse:[ |
|
2308 |
const isJavaClass ifTrue:[ |
|
2309 |
any := any or:[const fullName = aGlobalName]. |
|
2310 |
] ifFalse:[ |
|
2311 |
const isJavaClassRef ifTrue:[ |
|
2312 |
any := any or:[const fullName = aGlobalName]. |
|
2313 |
] |
|
2314 |
]. |
|
2315 |
]. |
|
2316 |
]. |
|
2317 |
any ifFalse:[^ false]. |
|
2318 |
||
2319 |
"/ sigh - must extract all accessed literals ... |
|
2320 |
"/ must deparse the byteCode in order to do this. |
|
2321 |
||
2322 |
walker := JavaByteCodeEnumerator new. |
|
2323 |
walker |
|
2324 |
literalAction: |
|
2325 |
[:pc :slotIndex :const | |
|
2326 |
|mSel| |
|
2327 |
||
2328 |
(const isNumber |
|
2329 |
or:[const isString |
|
2330 |
or:[const isNil]]) ifFalse:[ |
|
2331 |
const isJavaClass ifTrue:[ |
|
2332 |
mSel := const fullName. |
|
2333 |
] ifFalse:[ |
|
2334 |
const isJavaClassRef ifTrue:[ |
|
2335 |
mSel := const fullName. |
|
2336 |
] |
|
2337 |
]. |
|
2338 |
]. |
|
2339 |
mSel notNil ifTrue:[ |
|
2340 |
"/ Transcript showCR:mSel. |
|
2341 |
mSel = aGlobalName ifTrue:[ |
|
2342 |
^ true |
|
2343 |
] |
|
2344 |
]. |
|
2345 |
]. |
|
2346 |
walker decompile:self to:nil. |
|
2347 |
||
2348 |
"Created: / 9.11.1999 / 17:15:46 / cg" |
|
2349 |
"Modified: / 9.11.1999 / 17:18:02 / cg" |
|
2350 |
! |
|
2351 |
||
2352 |
sends:aSelectorSymbol |
|
2353 |
"return true, if this method contains a message-send |
|
2354 |
with aSelectorSymbol as selector." |
|
2355 |
||
2356 |
|walker any| |
|
2357 |
||
2358 |
"/ quick check, if constantPool includes a methodRef for this |
|
2359 |
"/ selector. |
|
2360 |
||
2361 |
any := false. |
|
2362 |
self javaClass constantPool do:[:const | |
|
2363 |
(const isNumber |
|
2364 |
or:[const isString |
|
2365 |
or:[const isNil]]) ifFalse:[ |
|
2366 |
const isJavaMethod ifTrue:[ |
|
2367 |
any := any or:[const selector = aSelectorSymbol]. |
|
2368 |
] ifFalse:[ |
|
2369 |
const isJavaMethodRef ifTrue:[ |
|
2370 |
any := any or:[const signature = aSelectorSymbol]. |
|
2371 |
] |
|
2372 |
]. |
|
2373 |
]. |
|
2374 |
]. |
|
2375 |
any ifFalse:[^ false]. |
|
2376 |
||
2377 |
"/ sigh - must extract all accessed literals ... |
|
2378 |
"/ must deparse the byteCode in order to do this. |
|
2379 |
||
2380 |
walker := JavaByteCodeEnumerator new. |
|
2381 |
walker |
|
2382 |
literalAction: |
|
2383 |
[:pc :slotIndex :const | |
|
2384 |
|mSel| |
|
2385 |
||
2386 |
(const isNumber |
|
2387 |
or:[const isString |
|
2388 |
or:[const isNil]]) ifFalse:[ |
|
2389 |
const isJavaMethod ifTrue:[ |
|
2390 |
mSel := const selector. |
|
2391 |
] ifFalse:[ |
|
2392 |
const isJavaMethodRef ifTrue:[ |
|
2393 |
mSel := const signature. |
|
2394 |
] |
|
2395 |
]. |
|
2396 |
]. |
|
2397 |
mSel notNil ifTrue:[ |
|
2398 |
"/ Transcript showCR:mSel. |
|
2399 |
mSel = aSelectorSymbol ifTrue:[ |
|
2400 |
^ true |
|
2401 |
] |
|
2402 |
]. |
|
2403 |
]. |
|
2404 |
walker decompile:self to:nil. |
|
2405 |
||
2406 |
"Created: / 9.11.1999 / 15:38:14 / cg" |
|
2407 |
"Modified: / 9.11.1999 / 17:06:03 / cg" |
|
2408 |
! |
|
2409 |
||
872 | 2410 |
shouldBeSkippedInDebuggersWalkBack |
2411 |
||
2412 |
^false |
|
2413 |
||
2414 |
"Created: / 30-11-2010 / 15:35:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2415 |
! |
|
2416 |
||
752 | 2417 |
who |
2418 |
"return the class and selector of where I am defined in." |
|
2419 |
||
2420 |
|sel| |
|
2421 |
||
2422 |
javaClass isNil ifTrue:[^ nil]. |
|
2423 |
sel := selector. |
|
2424 |
"/ sel := javaClass methodDictionary keyAtValue:self ifAbsent:nil. |
|
2425 |
sel isNil ifTrue:[^ nil]. |
|
2426 |
^ Method::MethodWhoInfo class:javaClass selector:sel. |
|
2427 |
||
2428 |
"Modified: / 16.10.1998 / 13:42:10 / cg" |
|
2429 |
! ! |
|
2430 |
||
2431 |
!JavaMethod methodsFor:'signature parsing'! |
|
2432 |
||
2433 |
XXXspecWithArgsFromSignature:aSignature withName:name in:aPackage |
|
2434 |
"given a signature, return a spec with args" |
|
2435 |
||
2436 |
|s argSpec retvalSpec| |
|
2437 |
||
2438 |
s := aSignature readStream. |
|
2439 |
s next ~~ $( ifTrue:[self halt. ^ name]. |
|
2440 |
||
2441 |
argSpec := self argSpecWithArgsFromStream:s in:aPackage. |
|
2442 |
||
2443 |
s next ~~ $) ifTrue:[self halt. ^ name]. |
|
2444 |
||
2445 |
retvalSpec := self retvalSpecFromStream:s in:aPackage. |
|
2446 |
||
2447 |
^ retvalSpec , ' ' , name , ' (' , argSpec , ')' |
|
2448 |
||
2449 |
" |
|
2450 |
JavaMethod specFromSignature:'(LObject;)V' withName:'foo' |
|
2451 |
JavaMethod specFromSignature:'(BB)S' withName:'foo' |
|
2452 |
" |
|
2453 |
||
2454 |
"Created: / 8.1.1998 / 19:17:58 / cg" |
|
2455 |
! ! |
|
2456 |
||
872 | 2457 |
!JavaMethod methodsFor:'testing'! |
2458 |
||
2459 |
isSynthetic |
|
1368 | 2460 |
^ (accessFlags bitAnd:A_SYNTHETIC) ~~ 0 |
872 | 2461 |
|
2462 |
"Created: / 18-10-2010 / 19:09:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2463 |
! ! |
|
2464 |
||
752 | 2465 |
!JavaMethod class methodsFor:'documentation'! |
2466 |
||
2467 |
version |
|
1026
5badd1d31864
introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents:
1022
diff
changeset
|
2468 |
^ '$Id$' |
752 | 2469 |
! |
2470 |
||
2471 |
version_CVS |
|
923 | 2472 |
^ '§Header: /cvs/stx/stx/libjava/JavaMethod.st,v 1.108 2011/08/19 13:49:39 cg Exp §' |
752 | 2473 |
! |
2474 |
||
2475 |
version_SVN |
|
1022 | 2476 |
^ '$Id$' |
752 | 2477 |
! ! |
2478 |
||
948 | 2479 |
JavaMethod initialize! |