author | vranyj1 |
Wed, 31 Aug 2011 22:30:01 +0000 | |
branch | jk_new_structure |
changeset 959 | 1f3342b2e728 |
parent 957 | 84a9553aa486 |
child 992 | 6d3e3d937fda |
permissions | -rw-r--r-- |
752 | 1 |
" |
877 | 2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
3 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
|
4 |
SWING Research Group, Czech Technical University in Prague |
|
5 |
||
6 |
Parts of the code written by Claus Gittinger are under following |
|
7 |
license: |
|
752 | 8 |
|
9 |
This software is furnished under a license and may be used |
|
10 |
only in accordance with the terms of that license and with the |
|
11 |
inclusion of the above copyright notice. This software may not |
|
12 |
be provided or otherwise made available to, or used by, any |
|
13 |
other person. No title to or ownership of the software is |
|
14 |
hereby transferred. |
|
877 | 15 |
|
16 |
Parts of the code written at SWING Reasearch Group [1] are MIT licensed: |
|
17 |
||
18 |
Permission is hereby granted, free of charge, to any person |
|
19 |
obtaining a copy of this software and associated documentation |
|
20 |
files (the 'Software'), to deal in the Software without |
|
21 |
restriction, including without limitation the rights to use, |
|
22 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
23 |
copies of the Software, and to permit persons to whom the |
|
24 |
Software is furnished to do so, subject to the following |
|
25 |
conditions: |
|
26 |
||
27 |
The above copyright notice and this permission notice shall be |
|
28 |
included in all copies or substantial portions of the Software. |
|
29 |
||
30 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
31 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
32 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
33 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
34 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
35 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
36 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
37 |
OTHER DEALINGS IN THE SOFTWARE. |
|
38 |
||
39 |
[1] Code written at SWING Research Group contain a signature |
|
40 |
of one of the above copright owners. |
|
752 | 41 |
" |
42 |
"{ Package: 'stx:libjava' }" |
|
43 |
||
44 |
Object subclass:#Java |
|
45 |
instanceVariableNames:'' |
|
959 | 46 |
classVariableNames:'Classes UnresolvedClassRefs Release ClassPath ClassPathExt |
47 |
SourceDirectories CacheDirectory JavaHome InternedStrings |
|
48 |
Java_lang_String Java_lang_Class PrettyPrintStyle |
|
49 |
LastArgumentString Threads ExcludedClassPath FailedToLoadClasses |
|
50 |
SourceCache SourceArchiveCache' |
|
752 | 51 |
poolDictionaries:'' |
52 |
category:'Languages-Java-Support' |
|
53 |
! |
|
54 |
||
55 |
!Java class methodsFor:'documentation'! |
|
56 |
||
57 |
copyright |
|
58 |
" |
|
877 | 59 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
60 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
|
61 |
SWING Research Group, Czech Technical University in Prague |
|
62 |
||
63 |
Parts of the code written by Claus Gittinger are under following |
|
64 |
license: |
|
752 | 65 |
|
66 |
This software is furnished under a license and may be used |
|
67 |
only in accordance with the terms of that license and with the |
|
68 |
inclusion of the above copyright notice. This software may not |
|
69 |
be provided or otherwise made available to, or used by, any |
|
70 |
other person. No title to or ownership of the software is |
|
71 |
hereby transferred. |
|
877 | 72 |
|
73 |
Parts of the code written at SWING Reasearch Group [1] are MIT licensed: |
|
74 |
||
75 |
Permission is hereby granted, free of charge, to any person |
|
76 |
obtaining a copy of this software and associated documentation |
|
77 |
files (the 'Software'), to deal in the Software without |
|
78 |
restriction, including without limitation the rights to use, |
|
79 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
80 |
copies of the Software, and to permit persons to whom the |
|
81 |
Software is furnished to do so, subject to the following |
|
82 |
conditions: |
|
752 | 83 |
|
877 | 84 |
The above copyright notice and this permission notice shall be |
85 |
included in all copies or substantial portions of the Software. |
|
752 | 86 |
|
877 | 87 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
88 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
89 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
90 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
91 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
92 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
93 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
94 |
OTHER DEALINGS IN THE SOFTWARE. |
|
95 |
||
96 |
[1] Code written at SWING Research Group contain a signature |
|
97 |
of one of the above copright owners. |
|
98 |
||
99 |
" |
|
752 | 100 |
! |
101 |
||
102 |
documentation |
|
103 |
"Java class is main entry point or - you might say - |
|
104 |
facade to the Java world inside Smalltalk. It also |
|
105 |
serves as configuration entity - e.g. controlling |
|
106 |
classpath, source paths, etc. Java class is responsible |
|
107 |
for correct initialization and glueing other classes. |
|
108 |
" |
|
109 |
! ! |
|
110 |
||
111 |
!Java class methodsFor:'accessing'! |
|
112 |
||
113 |
classForName:aString |
|
114 |
"return a javaClass - either existing or loaded" |
|
115 |
||
920 | 116 |
|cls loader| |
752 | 117 |
|
118 |
cls := self at:aString. |
|
119 |
cls isNil ifTrue:[ |
|
120 |
FailedToLoadClasses notNil ifTrue:[ |
|
121 |
(FailedToLoadClasses includes:aString) ifTrue:[ |
|
122 |
"/ ('JAVA [info]: class loading already failed: ' , aString) infoPrintCR. |
|
123 |
^ nil |
|
124 |
] |
|
125 |
]. |
|
126 |
||
920 | 127 |
"/('JAVA [info]: late class loading: ' , aString) infoPrintCR. |
752 | 128 |
loader := JavaClassReader classLoaderQuerySignal query. |
129 |
loader isNil ifTrue:[ |
|
130 |
"/ load using default (ST/X) loader |
|
131 |
cls := JavaClassReader loadClass:aString. |
|
132 |
] ifFalse:[ |
|
133 |
"/ load using a Java class loader |
|
134 |
"/ classURL := Java as_URL:('file:' , aString , '.class'). |
|
135 |
"/ loader loadClass:classURL. |
|
136 |
loader perform:#'loadClass(Ljava/lang/String;)Ljava/lang/Class;' |
|
957 | 137 |
with:(Java as_String:(aString copyReplaceAll:$/ with:$.)). |
752 | 138 |
|
139 |
cls := self at:aString. |
|
140 |
]. |
|
141 |
cls isNil ifTrue:[ |
|
142 |
FailedToLoadClasses isNil ifTrue:[ |
|
143 |
FailedToLoadClasses := Set new. |
|
144 |
]. |
|
145 |
FailedToLoadClasses add:aString |
|
146 |
] |
|
147 |
]. |
|
148 |
^ cls |
|
149 |
||
920 | 150 |
"Created: / 18-03-1997 / 16:45:57 / cg" |
151 |
"Modified: / 27-04-1998 / 15:00:52 / cg" |
|
152 |
"Modified: / 18-08-2011 / 19:30:50 / jv" |
|
957 | 153 |
"Modified: / 31-08-2011 / 22:16:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
752 | 154 |
! |
155 |
||
156 |
classNamed:aString |
|
157 |
^ self at:aString |
|
158 |
! |
|
159 |
||
160 |
intern:aJavaString |
|
161 |
|stString internedString| |
|
162 |
||
163 |
stString := self as_ST_String:aJavaString. |
|
164 |
internedString := InternedStrings at:stString ifAbsent:nil. |
|
165 |
internedString isNil ifTrue:[ |
|
166 |
InternedStrings at:stString put:aJavaString. |
|
167 |
internedString := aJavaString |
|
168 |
]. |
|
169 |
^ internedString |
|
170 |
! |
|
171 |
||
959 | 172 |
javaExtDirs |
173 |
||
174 |
^Java release javaExtDirs |
|
175 |
"/ ,{ |
|
176 |
"/ ((Smalltalk packageDirectoryForPackageId: 'stx:libjava') asFilename |
|
177 |
"/ / 'java' / 'libs') }. |
|
178 |
||
179 |
"Created: / 31-08-2011 / 22:55:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
180 |
! |
|
181 |
||
752 | 182 |
java_lang_Class |
183 |
Java_lang_Class isNil ifTrue:[ |
|
184 |
Java_lang_Class := self at:'java.lang.Class' |
|
185 |
]. |
|
186 |
^ Java_lang_Class |
|
187 |
||
188 |
"Created: 26.3.1997 / 13:42:59 / cg" |
|
189 |
"Modified: 26.3.1997 / 13:46:24 / cg" |
|
190 |
! |
|
191 |
||
192 |
java_lang_String |
|
193 |
Java_lang_String isNil ifTrue:[ |
|
194 |
Java_lang_String := self at:'java.lang.String' |
|
195 |
]. |
|
196 |
^ Java_lang_String |
|
197 |
||
198 |
"Created: 26.3.1997 / 13:43:17 / cg" |
|
199 |
"Modified: 26.3.1997 / 13:50:21 / cg" |
|
200 |
! |
|
201 |
||
202 |
prettyPrintStyle |
|
203 |
^ PrettyPrintStyle |
|
204 |
||
205 |
"Created: 1.8.1997 / 10:37:57 / cg" |
|
206 |
! |
|
207 |
||
208 |
release |
|
209 |
||
210 |
^Release |
|
211 |
||
212 |
"Created: / 22-11-2010 / 12:38:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
213 |
! |
|
214 |
||
215 |
release: aJavaRelease |
|
216 |
||
217 |
Release := aJavaRelease. |
|
218 |
||
219 |
" |
|
220 |
Java release: JavaRelease openJDK6. |
|
221 |
Java release: JavaRelease sunJDK6. |
|
222 |
||
223 |
" |
|
224 |
||
225 |
"Created: / 22-11-2010 / 12:38:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
226 |
"Modified: / 30-11-2010 / 11:54:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
227 |
! |
|
228 |
||
229 |
systemPropertyAt:key put:something |
|
230 |
JavaVM systemProperties at:key put:something |
|
231 |
||
232 |
"Created: / 9.1.1999 / 14:49:35 / cg" |
|
233 |
! |
|
234 |
||
235 |
threads |
|
236 |
Threads isNil ifTrue:[ |
|
237 |
Threads := WeakIdentityDictionary new. |
|
238 |
]. |
|
239 |
^ Threads |
|
240 |
||
241 |
"Created: 26.8.1997 / 19:53:57 / cg" |
|
242 |
"Modified: 26.8.1997 / 19:55:27 / cg" |
|
243 |
! ! |
|
244 |
||
245 |
!Java class methodsFor:'accessing paths'! |
|
246 |
||
247 |
addToClassPath:aPath |
|
248 |
||
249 |
| path | |
|
250 |
path := aPath asFilename. |
|
251 |
||
252 |
(aPath asString includes: $*) ifTrue:[ |
|
253 |
self addToClassPathFilesMatching: path baseName |
|
254 |
in: path directoryName. |
|
255 |
] ifFalse:[ |
|
256 |
(ClassPath includes:aPath asString) ifFalse:[ |
|
257 |
ClassPath add:aPath asString. |
|
883 | 258 |
self addToClassPathInRuntime:aPath. |
752 | 259 |
FailedToLoadClasses := nil |
260 |
] |
|
261 |
] |
|
262 |
||
263 |
"Created: / 01-08-1997 / 21:10:07 / cg" |
|
264 |
"Modified: / 17-09-1998 / 20:43:55 / cg" |
|
883 | 265 |
"Modified: / 07-08-2011 / 14:06:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
752 | 266 |
! |
267 |
||
268 |
addToClassPathFilesMatching: pattern in: path |
|
269 |
||
270 |
| dir | |
|
271 |
dir := path asFilename. |
|
272 |
dir directoryContents do: |
|
273 |
[:fname| |
|
274 |
(fname matches: pattern) ifTrue: |
|
275 |
[| p | |
|
276 |
p := (dir / fname) pathName. |
|
277 |
(ClassPath includes:p) ifFalse: |
|
278 |
[ClassPath add:p. |
|
883 | 279 |
self addToClassPathInRuntime:p. |
752 | 280 |
FailedToLoadClasses := nil]]]. |
281 |
||
282 |
"Created: / 20-12-2010 / 17:26:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
283 |
! |
|
284 |
||
883 | 285 |
addToClassPathInRuntime:aPath |
286 |
||
912
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
908
diff
changeset
|
287 |
| path file url scl | |
883 | 288 |
"Java might not be loaded/or initialized, in this case |
289 |
there is no no need to inform java about new entry in classpath" |
|
889 | 290 |
|
291 |
JavaVM booted ifFalse:[^self]. |
|
912
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
908
diff
changeset
|
292 |
scl := (Java classForName:'java.lang.ClassLoader') instVarNamed: #scl. |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
908
diff
changeset
|
293 |
scl ifNil:[ |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
908
diff
changeset
|
294 |
scl := (Java classForName:'java.lang.ClassLoader') perform: #'getSystemClassLoader()Ljava/lang/ClassLoader;'. |
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
908
diff
changeset
|
295 |
]. |
883 | 296 |
path := Java as_String: aPath asString. |
297 |
file := (Java at:'java.io.File') new perform: #'<init>(Ljava/lang/String;)V' with: path; yourself. |
|
298 |
url := file perform: #'toURL()Ljava/net/URL;'. |
|
889 | 299 |
scl perform: #'addURL(Ljava/net/URL;)V' with: url. |
883 | 300 |
|
301 |
"Created: / 01-08-1997 / 21:10:07 / cg" |
|
302 |
"Modified: / 17-09-1998 / 20:43:55 / cg" |
|
303 |
"Created: / 07-08-2011 / 14:01:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
304 |
! |
|
305 |
||
752 | 306 |
addToSourcePath:aPath |
307 |
SourceDirectories ifNil:[SourceDirectories := OrderedCollection new]. |
|
308 |
(SourceDirectories includes:aPath) ifFalse:[ |
|
309 |
SourceDirectories add:aPath |
|
310 |
] |
|
311 |
||
312 |
"Created: / 02-08-1997 / 14:12:31 / cg" |
|
313 |
"Modified: / 06-02-2011 / 22:51:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
314 |
! |
|
315 |
||
754 | 316 |
cacheDirectory |
317 |
||
756 | 318 |
CacheDirectory ifNil:[ |
319 |
CacheDirectory := Filename homeDirectory / '.smalltalk' / 'libjava' / 'caches' / |
|
758 | 320 |
(((Smalltalk at:#stx_libjava) svnRepositoryUrlBase copyReplaceAll:$/ with:$_) replaceAll:$: with:$_) |
756 | 321 |
]. |
322 |
^CacheDirectory |
|
754 | 323 |
|
324 |
"Created: / 08-04-2011 / 15:02:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
756 | 325 |
"Modified: / 08-04-2011 / 16:58:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
754 | 326 |
! |
327 |
||
752 | 328 |
classPath |
908
d990d0d520d9
ClassLoader trickery, maybe not a good idea, we will see.
vranyj1
parents:
906
diff
changeset
|
329 |
|
959 | 330 |
| CLASSPATH packagePath | |
331 |
packagePath := (Smalltalk packageDirectoryForPackageId:'stx:libjava'). |
|
908
d990d0d520d9
ClassLoader trickery, maybe not a good idea, we will see.
vranyj1
parents:
906
diff
changeset
|
332 |
CLASSPATH := ((OperatingSystem getEnvironment: 'CLASSPATH') ? '') |
d990d0d520d9
ClassLoader trickery, maybe not a good idea, we will see.
vranyj1
parents:
906
diff
changeset
|
333 |
tokensBasedOn: OperatingSystem pathSeparator. |
752 | 334 |
|
908
d990d0d520d9
ClassLoader trickery, maybe not a good idea, we will see.
vranyj1
parents:
906
diff
changeset
|
335 |
^ |
d990d0d520d9
ClassLoader trickery, maybe not a good idea, we will see.
vranyj1
parents:
906
diff
changeset
|
336 |
"for testing only" |
d990d0d520d9
ClassLoader trickery, maybe not a good idea, we will see.
vranyj1
parents:
906
diff
changeset
|
337 |
"/Release classPath, |
959 | 338 |
{ |
339 |
( packagePath / 'java' / 'libjava-projects' / 'Conversion' / 'bin' ) pathName. |
|
340 |
( packagePath / 'java' / 'libjava-support' / 'bin' ) pathName |
|
341 |
}, |
|
342 |
||
343 |
( |
|
344 |
(packagePath / 'java' / 'libs') directoryContentsAsFilenames |
|
345 |
select:[:f|f suffix = 'jar'] |
|
346 |
thenCollect:[:f|f pathName] |
|
908
d990d0d520d9
ClassLoader trickery, maybe not a good idea, we will see.
vranyj1
parents:
906
diff
changeset
|
347 |
), |
d990d0d520d9
ClassLoader trickery, maybe not a good idea, we will see.
vranyj1
parents:
906
diff
changeset
|
348 |
|
d990d0d520d9
ClassLoader trickery, maybe not a good idea, we will see.
vranyj1
parents:
906
diff
changeset
|
349 |
(ClassPath ? #()), |
d990d0d520d9
ClassLoader trickery, maybe not a good idea, we will see.
vranyj1
parents:
906
diff
changeset
|
350 |
CLASSPATH |
d990d0d520d9
ClassLoader trickery, maybe not a good idea, we will see.
vranyj1
parents:
906
diff
changeset
|
351 |
|
d990d0d520d9
ClassLoader trickery, maybe not a good idea, we will see.
vranyj1
parents:
906
diff
changeset
|
352 |
" |
d990d0d520d9
ClassLoader trickery, maybe not a good idea, we will see.
vranyj1
parents:
906
diff
changeset
|
353 |
Java classPath |
d990d0d520d9
ClassLoader trickery, maybe not a good idea, we will see.
vranyj1
parents:
906
diff
changeset
|
354 |
" |
d990d0d520d9
ClassLoader trickery, maybe not a good idea, we will see.
vranyj1
parents:
906
diff
changeset
|
355 |
|
d990d0d520d9
ClassLoader trickery, maybe not a good idea, we will see.
vranyj1
parents:
906
diff
changeset
|
356 |
"Created: / 07-02-1997 / 19:23:45 / cg" |
959 | 357 |
"Modified: / 31-08-2011 / 23:23:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
752 | 358 |
! |
359 |
||
360 |
classPath:aCollectionOfPaths |
|
361 |
ClassPath := aCollectionOfPaths asOrderedCollection. |
|
362 |
FailedToLoadClasses := nil |
|
363 |
||
364 |
"Created: / 7.2.1997 / 19:23:45 / cg" |
|
365 |
"Modified: / 17.9.1998 / 20:44:09 / cg" |
|
366 |
! |
|
367 |
||
368 |
effectiveClassPath |
|
369 |
||
959 | 370 |
ClassPathExt ifNil:[ |
371 |
ClassPathExt := OrderedCollection new. |
|
372 |
self javaExtDirs do:[:dir| |
|
373 |
dir isDirectory ifTrue:[ |
|
374 |
dir directoryContentsAsFilenamesDo:[:file| |
|
375 |
file suffix = 'jar' ifTrue:[ |
|
376 |
ClassPathExt add: file pathName |
|
377 |
] |
|
378 |
] |
|
379 |
] |
|
380 |
] |
|
381 |
]. |
|
382 |
||
383 |
^self release classPath , "ClassPathExt ," self classPath |
|
752 | 384 |
|
385 |
" |
|
908
d990d0d520d9
ClassLoader trickery, maybe not a good idea, we will see.
vranyj1
parents:
906
diff
changeset
|
386 |
Java effectiveClassPath |
752 | 387 |
" |
388 |
||
389 |
"Created: / 22-11-2010 / 13:03:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
390 |
"Modified: / 17-01-2011 / 09:44:16 / kursjan <kursjan@fit.cvut.cz>" |
|
959 | 391 |
"Modified: / 31-08-2011 / 23:17:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
752 | 392 |
! |
393 |
||
394 |
effectiveSourceDirectories |
|
395 |
||
396 |
^Release sourcePath , |
|
397 |
(SourceDirectories ? #()) |
|
398 |
||
399 |
" |
|
400 |
Java effectiveSourceDirectories |
|
401 |
" |
|
402 |
||
403 |
"Created: / 30-11-2010 / 11:53:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
404 |
! |
|
405 |
||
406 |
excludedClassPath |
|
407 |
^ ExcludedClassPath |
|
408 |
||
409 |
"Modified: / 7.2.1997 / 19:23:55 / cg" |
|
410 |
"Created: / 27.1.1998 / 21:57:13 / cg" |
|
411 |
! |
|
412 |
||
413 |
isExcludedFromClassPath:fileName |
|
414 |
|nm| |
|
415 |
||
416 |
nm := fileName asFilename pathName. |
|
417 |
ExcludedClassPath do:[:excludedPath | |
|
418 |
(nm startsWith:excludedPath) ifTrue:[^ true]. |
|
419 |
]. |
|
420 |
^ false |
|
421 |
||
422 |
"Created: / 27.1.1998 / 22:00:40 / cg" |
|
423 |
! |
|
424 |
||
425 |
javaHome |
|
426 |
^ JavaHome ifNil:[Release javaHome] |
|
427 |
||
428 |
"Created: / 06-08-1997 / 00:53:19 / cg" |
|
429 |
"Modified: / 22-11-2010 / 12:39:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
430 |
! |
|
431 |
||
432 |
javaHome:aPath |
|
433 |
||
434 |
<resource: #obsolete> |
|
435 |
||
436 |
self obsoleteMethodWarning: 'javaHome is now controlled by java release'. |
|
437 |
||
438 |
JavaHome := aPath |
|
439 |
||
440 |
"Created: / 06-08-1997 / 00:53:23 / cg" |
|
441 |
"Modified: / 22-11-2010 / 12:40:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
442 |
! |
|
443 |
||
444 |
newJavaHome:newJavaHome |
|
445 |
self javaHome:newJavaHome. |
|
446 |
||
447 |
! |
|
448 |
||
449 |
removeFromClassPath:aPath |
|
450 |
(ClassPath includes:aPath) ifTrue:[ |
|
451 |
ClassPath remove:aPath |
|
452 |
] |
|
453 |
||
454 |
"Modified: 7.2.1997 / 19:23:55 / cg" |
|
455 |
"Created: 1.8.1997 / 21:10:21 / cg" |
|
456 |
! |
|
457 |
||
458 |
removeFromSourcePath:aPath |
|
459 |
(SourceDirectories includes:aPath) ifTrue:[ |
|
460 |
SourceDirectories remove:aPath |
|
461 |
] |
|
462 |
||
463 |
"Modified: 7.2.1997 / 19:23:55 / cg" |
|
464 |
"Created: 2.8.1997 / 14:13:01 / cg" |
|
465 |
! |
|
466 |
||
467 |
sourceDirectories |
|
468 |
^ SourceDirectories |
|
469 |
! |
|
470 |
||
471 |
sourceDirectories:aCollectionOfPaths |
|
472 |
SourceDirectories := aCollectionOfPaths asOrderedCollection |
|
473 |
||
474 |
" |
|
475 |
Java |
|
476 |
sourceDirectories:#( |
|
477 |
'/phys/ibm3/java/src' |
|
478 |
) |
|
479 |
" |
|
480 |
||
481 |
||
482 |
! |
|
483 |
||
484 |
sourcePath |
|
485 |
^ SourceDirectories |
|
486 |
||
487 |
"Created: / 16.1.1998 / 13:26:55 / cg" |
|
488 |
! ! |
|
489 |
||
490 |
!Java class methodsFor:'change & update'! |
|
491 |
||
492 |
update: what with: param from: sender |
|
493 |
||
494 |
what == #restarted ifTrue:[ |
|
495 |
self reinitialize. |
|
496 |
] |
|
497 |
||
498 |
"Created: / 14-12-2010 / 21:00:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
499 |
! ! |
|
500 |
||
501 |
!Java class methodsFor:'class initialization'! |
|
502 |
||
503 |
initAllClasses |
|
504 |
|system| |
|
505 |
||
506 |
FailedToLoadClasses := nil. |
|
507 |
self initAllStaticFields. |
|
508 |
||
509 |
system := self classForName:'java.lang.System'. |
|
510 |
system isInitialized ifFalse:[ |
|
511 |
self initSystemClass. |
|
512 |
]. |
|
513 |
||
514 |
self allClassesDo:[:cls | |
|
515 |
cls isInitialized ifFalse:[ |
|
516 |
cls classInit |
|
517 |
] |
|
518 |
] |
|
519 |
||
520 |
" |
|
521 |
Java initAllClasses |
|
522 |
" |
|
523 |
||
524 |
"Modified: / 27.11.1998 / 00:33:05 / cg" |
|
525 |
! |
|
526 |
||
527 |
initAllStaticFields |
|
528 |
self allClassesDo:[:cls | |
|
529 |
cls initializeStaticFields |
|
530 |
] |
|
531 |
||
532 |
! |
|
533 |
||
534 |
initSystemClass |
|
535 |
|system| |
|
536 |
||
537 |
system := Java at:'java.lang.System'. |
|
538 |
system isNil ifTrue:[ |
|
539 |
"/ JavaVM initializeVM. |
|
540 |
"/ system := Java at:'java.lang.System'. |
|
541 |
"/ system isNil ifTrue:[ |
|
542 |
self warn:'JavaVM: no ''' , 'java.lang.System' allBold , ''' class.'. |
|
543 |
"/ self error:'no ''java.lang.System'' class'. |
|
544 |
^ self |
|
545 |
"/ ]. |
|
546 |
]. |
|
547 |
||
548 |
system classInit. |
|
549 |
(system implements:#'initializeSystemClass()V') ifTrue:[ |
|
550 |
system perform: "invokeStatic:" #'initializeSystemClass()V'. |
|
551 |
]. |
|
552 |
||
553 |
" |
|
554 |
Java initSystemClass |
|
555 |
||
556 |
(Java at:'java.lang.System') |
|
557 |
perform:#'getProperty(Ljava/lang/String;)Ljava/lang/String;' |
|
558 |
with:(Java as_String:'java.home') |
|
559 |
" |
|
560 |
||
561 |
"Modified: / 10.11.1998 / 12:39:58 / cg" |
|
562 |
! |
|
563 |
||
564 |
initialize |
|
565 |
JavaNativeMethod flushAllCachedNativeMethods. |
|
566 |
||
567 |
InternedStrings := Dictionary new. |
|
568 |
FailedToLoadClasses := nil. |
|
569 |
||
570 |
ClassPath := OrderedCollection new. |
|
959 | 571 |
ClassPathExt := nil. |
752 | 572 |
ExcludedClassPath := OrderedCollection new. |
573 |
||
574 |
SourceCache := CacheDictionary new: 32. |
|
575 |
SourceArchiveCache := CacheDictionary new: 32. |
|
576 |
||
577 |
self initializeRelease. "lazy initialization of Release" |
|
578 |
||
579 |
self initializePrettyPrintStyle. |
|
580 |
||
581 |
ObjectMemory addDependent: self. |
|
582 |
||
583 |
" |
|
584 |
Java flushAllJavaResources. |
|
585 |
Java initialize. |
|
586 |
JavaVM initializeVM |
|
587 |
Java classPath inspect |
|
588 |
" |
|
589 |
||
590 |
"Modified: / 06-11-2001 / 09:24:12 / cg" |
|
591 |
"Created: / 03-10-2010 / 15:54:02 / Jan Kurs <kurs.jan@post.cz>" |
|
592 |
"Modified: / 15-10-2010 / 17:37:20 / Jan Kurs <kurs.jan@post.cz>" |
|
959 | 593 |
"Modified: / 31-08-2011 / 22:50:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
752 | 594 |
! |
595 |
||
596 |
initializeForNewClassPath:directoriesToSearch |
|
597 |
|jClasses jHome jSources| |
|
598 |
||
599 |
jClasses := OrderedCollection new. |
|
600 |
||
601 |
directoriesToSearch do:[:aPath | |
|
602 |
|dir libDir toAdd| |
|
603 |
||
604 |
dir := aPath asFilename. |
|
605 |
(jHome isNil and:[dir exists]) ifTrue:[ |
|
606 |
((dir hasSuffix:'jar') |
|
607 |
or:[dir hasSuffix:'zip']) ifTrue:[ |
|
608 |
toAdd := dir pathName. |
|
609 |
] ifFalse:[ |
|
610 |
||
611 |
"/ there must be either a classes directory, |
|
612 |
"/ or a classes.zip file ... |
|
613 |
(libDir := dir construct:'lib') exists ifTrue:[ |
|
614 |
((libDir construct:'classes') exists |
|
615 |
and:[(libDir construct:'classes') isDirectory]) ifTrue:[ |
|
616 |
jHome := aPath. |
|
617 |
toAdd := (libDir constructString:'classes'). |
|
618 |
] ifFalse:[ |
|
619 |
(libDir construct:'classes.zip') exists ifTrue:[ |
|
620 |
jHome := aPath. |
|
621 |
toAdd := (libDir constructString:'classes.zip'). |
|
622 |
] ifFalse:[ |
|
623 |
(libDir construct:'rt.jar') exists ifTrue:[ |
|
624 |
jHome := aPath. |
|
625 |
toAdd := (libDir constructString:'rt.jar'). |
|
626 |
]. |
|
627 |
(libDir construct:'rt.zip') exists ifTrue:[ |
|
628 |
jHome := aPath. |
|
629 |
toAdd := (libDir constructString:'rt.zip'). |
|
630 |
] |
|
631 |
] |
|
632 |
] |
|
633 |
] ifFalse:[ |
|
634 |
((dir construct:'classes') exists |
|
635 |
and:[(dir construct:'classes') isDirectory]) ifTrue:[ |
|
636 |
jHome := aPath. |
|
637 |
toAdd := (dir constructString:'classes'). |
|
638 |
] ifFalse:[ |
|
639 |
(dir construct:'classes.zip') exists ifTrue:[ |
|
640 |
jHome := aPath. |
|
641 |
toAdd := (dir constructString:'classes.zip'). |
|
642 |
] ifFalse:[ |
|
643 |
(dir construct:'rt.zip') exists ifTrue:[ |
|
644 |
jHome := aPath. |
|
645 |
toAdd := (dir constructString:'rt.zip'). |
|
646 |
] |
|
647 |
] |
|
648 |
] |
|
649 |
]. |
|
650 |
]. |
|
651 |
]. |
|
652 |
toAdd notNil ifTrue:[ |
|
653 |
Transcript showCR:'Adding to classPath: ' , toAdd. |
|
654 |
jClasses add:toAdd. |
|
655 |
]. |
|
656 |
]. |
|
657 |
||
658 |
self javaHome:jHome. |
|
659 |
self classPath:(jClasses collect:[:f | f asFilename name]). |
|
660 |
jHome isNil ifTrue:[ |
|
661 |
Transcript showCR:'no java home directory found'. |
|
662 |
] ifFalse:[ |
|
663 |
jHome := jHome asFilename. |
|
664 |
Transcript showCR:'Found javaHome in: ' , jHome pathName. |
|
665 |
||
666 |
(jSources := jHome construct:'source') exists ifFalse:[ |
|
667 |
(jSources := jHome construct:'src') exists ifFalse:[ |
|
668 |
(jSources := jHome construct:'sources') exists ifFalse:[ |
|
669 |
(jSources := jHome construct:'src.zip') exists ifFalse:[ |
|
670 |
jSources := nil. |
|
671 |
] |
|
672 |
] |
|
673 |
] |
|
674 |
]. |
|
675 |
||
676 |
jSources isNil ifTrue:[ |
|
677 |
Transcript showCR:'no java source directory found'. |
|
678 |
] ifFalse:[ |
|
679 |
Transcript showCR:'Found javaSources in: ' , jSources pathName. |
|
680 |
self sourceDirectories:(Array with:jSources pathName). |
|
681 |
]. |
|
682 |
]. |
|
683 |
||
684 |
" |
|
685 |
self initializeForNewClassPath:(Java classPath) |
|
686 |
self initializeForNewClassPath:(Array with:'/home/java/jdk113') |
|
687 |
" |
|
688 |
||
689 |
"Modified: / 03-10-2010 / 15:49:02 / Jan Kurs <kurs.jan@post.cz>" |
|
690 |
"Modified: / 19-10-2010 / 10:49:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
691 |
! |
|
692 |
||
693 |
initializePrettyPrintStyle |
|
694 |
PrettyPrintStyle := IdentityDictionary new. |
|
695 |
PrettyPrintStyle at:#accessAttribute put:(#color -> (Color red:0 green:0 blue:25)). |
|
696 |
PrettyPrintStyle at:#className put:(Array with:(#color -> Color black) with:#bold). |
|
697 |
PrettyPrintStyle at:#methodName put:(Array with:(#color -> Color black) with:#bold). |
|
698 |
PrettyPrintStyle at:#code put:(#color -> Color black). |
|
699 |
||
700 |
||
701 |
" |
|
702 |
Java initializePrettyPrintStyle |
|
703 |
" |
|
704 |
||
705 |
"Created: 1.8.1997 / 11:08:43 / cg" |
|
706 |
"Modified: 1.8.1997 / 11:09:58 / cg" |
|
707 |
! |
|
708 |
||
709 |
initializeRelease |
|
710 |
||
711 |
Release ifNil:[Release := JavaRelease any]. |
|
712 |
||
713 |
" |
|
714 |
Release := nil. |
|
715 |
self initializeRelease. |
|
716 |
Release |
|
717 |
" |
|
718 |
||
719 |
"Created: / 22-11-2010 / 13:41:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
720 |
! |
|
721 |
||
722 |
reinitAllClasses |
|
723 |
self markAllClassesUninitialized. |
|
724 |
self initAllClasses |
|
725 |
||
726 |
" |
|
727 |
Java reinitAllClasses |
|
728 |
" |
|
729 |
||
730 |
"Modified: / 4.1.1998 / 00:34:29 / cg" |
|
731 |
! |
|
732 |
||
733 |
reinitialize |
|
734 |
"/ all JavaThreads are lost on a restart (for now) |
|
735 |
||
736 |
FailedToLoadClasses := nil. |
|
737 |
Threads := nil. |
|
738 |
||
739 |
"Kludge" |
|
740 |
JavaMethod reinitialize. |
|
741 |
JavaMethodWithException reinitialize. |
|
742 |
JavaMethodWithHandler reinitialize. |
|
743 |
JavaNativeMethod reinitialize. |
|
744 |
JavaNativeMethod flushAllCachedNativeMethods. |
|
745 |
||
746 |
||
747 |
" |
|
748 |
Java reinitialize |
|
749 |
" |
|
750 |
||
751 |
"Created: / 26-08-1997 / 20:07:00 / cg" |
|
752 |
"Modified: / 27-04-1998 / 14:57:23 / cg" |
|
753 |
"Modified: / 14-12-2010 / 21:30:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
754 |
! |
|
755 |
||
756 |
startupJavaSystem |
|
757 |
|javaEventThread haveEventThread haveScreenUpdater| |
|
758 |
||
759 |
FailedToLoadClasses := nil. |
|
760 |
||
761 |
"/ |
|
762 |
"/ check if already running |
|
763 |
"/ |
|
764 |
||
765 |
haveEventThread := true. |
|
766 |
javaEventThread := JavaVM javaEventThread. |
|
767 |
(javaEventThread isNil or:[javaEventThread isDead]) ifTrue:[ |
|
768 |
haveEventThread := false |
|
769 |
]. |
|
770 |
||
771 |
haveScreenUpdater := false. |
|
772 |
haveEventThread ifTrue:[ |
|
773 |
self threads do:[:aJavaThread | |
|
774 |
aJavaThread name = 'JAVA-Screen Updater' ifTrue:[ |
|
775 |
aJavaThread isDead ifFalse:[ |
|
776 |
"/ already running |
|
777 |
haveScreenUpdater := true |
|
778 |
] |
|
779 |
] |
|
780 |
]. |
|
781 |
]. |
|
782 |
||
783 |
(haveEventThread and:[haveScreenUpdater]) ifTrue:[ |
|
784 |
^ self |
|
785 |
]. |
|
786 |
||
787 |
JavaClass orderOfClassInits isNil ifTrue:[ |
|
788 |
"/ the very first start ... |
|
789 |
'JAVA [info]: (re)initializing JAVA environment completely ...' infoPrintCR. |
|
790 |
||
791 |
JavaVM initializeVM. |
|
792 |
] ifFalse:[ |
|
793 |
JavaVM initializeVMIfNoEventThreadRunning |
|
794 |
]. |
|
795 |
'JAVA [info]: done JAVA initialization.' infoPrintCR. |
|
796 |
||
797 |
" |
|
798 |
Java startupJavaSystem |
|
799 |
" |
|
800 |
||
801 |
"Modified: / 24.12.1999 / 01:37:49 / cg" |
|
802 |
! |
|
803 |
||
804 |
terminateAllThreads |
|
805 |
|myself threadsToKill| |
|
806 |
||
807 |
Threads isNil ifTrue:[ |
|
808 |
^ self |
|
809 |
]. |
|
810 |
||
811 |
myself := Processor activeProcess. |
|
812 |
||
813 |
threadsToKill := IdentitySet new. |
|
814 |
Threads do:[:aJavaThread | |
|
815 |
aJavaThread ~~ myself ifTrue:[ |
|
816 |
(aJavaThread isNil or:[aJavaThread == 0]) ifFalse:[ |
|
817 |
(aJavaThread isMemberOf:JavaProcess) ifTrue:[ |
|
818 |
aJavaThread isDead ifFalse:[ |
|
819 |
threadsToKill add:aJavaThread |
|
820 |
] |
|
821 |
] |
|
822 |
] |
|
823 |
] |
|
824 |
]. |
|
825 |
threadsToKill do:[:aThread | |
|
826 |
aThread == JavaVM javaScreenUpdaterThread ifTrue:[self halt]. |
|
827 |
aThread == JavaVM javaEventQueueThread ifTrue:[self halt]. |
|
828 |
aThread terminate |
|
829 |
]. |
|
830 |
Threads := nil. |
|
831 |
||
832 |
" |
|
833 |
Java terminateAllThreads |
|
834 |
" |
|
835 |
||
836 |
"Created: / 26.8.1997 / 19:57:40 / cg" |
|
837 |
"Modified: / 24.12.1999 / 02:34:53 / cg" |
|
838 |
! ! |
|
839 |
||
840 |
!Java class methodsFor:'enumerating'! |
|
841 |
||
842 |
allClasses |
|
843 |
^ Classes ? #() |
|
844 |
||
845 |
" |
|
846 |
|if| |
|
847 |
||
848 |
if := Java at:'java.awt.GraphicsEnvironment'. |
|
849 |
Java allClasses select:[:aClass | |
|
850 |
aClass hasInterface:if |
|
851 |
] |
|
852 |
" |
|
853 |
||
854 |
"Modified: / 28.1.1998 / 01:42:04 / cg" |
|
855 |
! |
|
856 |
||
857 |
allClassesDo:aBlock |
|
858 |
Classes notNil ifTrue:[ |
|
859 |
Classes do:aBlock |
|
860 |
] |
|
861 |
! ! |
|
862 |
||
863 |
!Java class methodsFor:'object conversions'! |
|
864 |
||
865 |
as_Float:aNumber |
|
866 |
"convert an ST-float into a Java Float" |
|
867 |
||
868 |
|i| |
|
869 |
||
870 |
i := (Java at:'java.lang.Float') new. |
|
871 |
i perform:#'<init>(F)V' with:(aNumber asShortFloat). |
|
872 |
^ i |
|
873 |
||
874 |
" |
|
875 |
Java as_Float:1 |
|
876 |
Java as_Float:3.14159 |
|
877 |
" |
|
878 |
||
879 |
"Created: 7.8.1997 / 21:21:13 / cg" |
|
880 |
"Modified: 7.8.1997 / 21:22:05 / cg" |
|
881 |
! |
|
882 |
||
883 |
as_Hashtable:aDictionary |
|
884 |
"given a smalltalk dictionary, create and return |
|
885 |
a Java hashTable for it" |
|
886 |
||
887 |
|hashTable| |
|
888 |
||
889 |
hashTable := (self classForName:'java.util.Hashtable') new. |
|
890 |
aDictionary keysAndValuesDo:[:k :v | |
|
891 |
|sk sv jk jv| |
|
892 |
||
893 |
(sk := k) isSymbol ifTrue:[ |
|
894 |
sk := sk asString |
|
895 |
]. |
|
896 |
(sv := v) isSymbol ifTrue:[ |
|
897 |
sv := sv asString |
|
898 |
]. |
|
899 |
jk := self as_Object:sk. |
|
900 |
jv := self as_Object:sv. |
|
901 |
||
902 |
hashTable |
|
903 |
perform:#'put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' |
|
904 |
with:jk |
|
905 |
with:jv. |
|
906 |
]. |
|
907 |
^ hashTable |
|
908 |
||
909 |
" |
|
910 |
Java as_Hashtable:(Dictionary new |
|
911 |
at:'hello' put:'Hallo'; |
|
912 |
at:'world' put:'Welt'; |
|
913 |
yourself) |
|
914 |
" |
|
915 |
||
916 |
"Modified: / 14.1.1998 / 17:02:13 / cg" |
|
917 |
! |
|
918 |
||
919 |
as_Integer:anInteger |
|
920 |
"convert an ST-integer into a Java Integer" |
|
921 |
||
922 |
|i| |
|
923 |
||
924 |
i := (Java at:'java.lang.Integer') new. |
|
925 |
i perform:#'<init>(I)V' with:anInteger. |
|
926 |
^ i |
|
927 |
||
928 |
" |
|
929 |
Java as_Integer:1 |
|
930 |
" |
|
931 |
||
932 |
"Modified: 7.8.1997 / 21:19:37 / cg" |
|
933 |
"Created: 7.8.1997 / 21:21:13 / cg" |
|
934 |
! |
|
935 |
||
936 |
as_Object:anObject |
|
937 |
"convert an ST-Object into a Java Object" |
|
938 |
||
939 |
anObject isString ifTrue:[ |
|
940 |
^ self as_String:anObject |
|
941 |
]. |
|
942 |
anObject isInteger ifTrue:[ |
|
943 |
^ self as_Integer:anObject |
|
944 |
]. |
|
945 |
||
946 |
self halt. |
|
947 |
||
948 |
" |
|
949 |
Java as_Object:'hello world' |
|
950 |
" |
|
951 |
||
952 |
"Created: 7.8.1997 / 21:15:38 / cg" |
|
953 |
"Modified: 7.8.1997 / 21:20:07 / cg" |
|
954 |
! |
|
955 |
||
956 |
as_ST_String: aJavaString |
|
957 |
"hard-coding internas of java.lang.String here is bad ..." |
|
958 |
||
959 |
| str count offs start stop | |
|
960 |
||
961 |
aJavaString isNil ifTrue: [ ^ nil ]. |
|
962 |
||
963 |
"/ count := aJavaString instVarNamed:'count'. |
|
964 |
||
965 |
count := aJavaString instVarAt: 3. |
|
966 |
||
967 |
"/ str := aJavaString instVarNamed:'value' |
|
968 |
||
969 |
str := aJavaString instVarAt: 1. |
|
970 |
str size == count |
|
971 |
ifTrue: |
|
972 |
[ "cos I don't see any reason to do this" |
|
973 |
"/ ^ str asOneByteString. |
|
906
fea23aa2b228
Few more fixes and workarounds for Saxon 6.5.5: the Othello example works fine...
vranyj1
parents:
889
diff
changeset
|
974 |
^ str ]. |
752 | 975 |
|
976 |
"/ offs := (aJavaString instVarNamed:'offset'). |
|
977 |
||
978 |
offs := aJavaString instVarAt: 2. |
|
979 |
||
980 |
"/ start := offs + 1. |
|
981 |
||
982 |
start := offs + 1. |
|
983 |
||
984 |
"/ stop := start + (aJavaString instVarNamed:'count') - 1. |
|
985 |
||
986 |
stop := start + count - 1. |
|
987 |
||
988 |
"/ ^ ((aJavaString instVarNamed:'value') copyFrom:start to:stop) asString |
|
989 |
||
990 |
^ (str copyFrom: start to: stop) asOneByteString |
|
991 |
||
992 |
"Created: / 08-08-1997 / 12:02:55 / cg" |
|
993 |
"Modified: / 04-01-1999 / 23:55:08 / cg" |
|
994 |
"Modified: / 22-03-2011 / 17:21:19 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
906
fea23aa2b228
Few more fixes and workarounds for Saxon 6.5.5: the Othello example works fine...
vranyj1
parents:
889
diff
changeset
|
995 |
"Modified: / 10-08-2011 / 23:32:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
752 | 996 |
! |
997 |
||
998 |
as_String:aString |
|
999 |
"convert an ST-String into a Java String" |
|
1000 |
||
1001 |
"hard-coding internas of java.lang.String here is bad ..." |
|
1002 |
||
1003 |
|s| |
|
1004 |
||
1005 |
s := Java_lang_String basicNew. |
|
1006 |
s instVarNamed:'value' put: aString. |
|
1007 |
s instVarNamed:'offset' put: 0. |
|
1008 |
s instVarNamed:'count' put: aString size. |
|
1009 |
s instVarNamed:'hash' put: 0. |
|
1010 |
^ s |
|
1011 |
||
1012 |
" |
|
1013 |
Java as_String:'hello world' |
|
1014 |
" |
|
1015 |
||
1016 |
"Created: / 07-08-1997 / 21:15:49 / cg" |
|
1017 |
"Modified: / 03-02-2011 / 23:33:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1018 |
! |
|
1019 |
||
1020 |
as_URL:aString |
|
1021 |
"convert an ST-String into a Java String" |
|
1022 |
||
1023 |
"hard-coding internas of java.lang.String here is bad ..." |
|
1024 |
||
1025 |
|u s| |
|
1026 |
||
1027 |
s := aString. |
|
1028 |
||
1029 |
"/ kludge for volume |
|
1030 |
OperatingSystem isMSDOSlike ifTrue:[ |
|
1031 |
((s size > 1) and:[(s at:2) == $:]) ifTrue:[ |
|
1032 |
s := 'file:' , (s copy at:2 put:$|) |
|
1033 |
] |
|
1034 |
]. |
|
1035 |
u := (self at:'java.net.URL') newCleared. |
|
1036 |
u perform:#'<init>(Ljava/lang/String;)V' with:(self as_String:s). |
|
1037 |
^ u |
|
1038 |
||
1039 |
" |
|
1040 |
Java as_URL:'http://www.altavista.com' |
|
1041 |
Java as_URL:'file:/foo/bar' |
|
1042 |
" |
|
1043 |
||
1044 |
"Created: / 7.8.1997 / 21:15:49 / cg" |
|
1045 |
"Modified: / 25.9.1999 / 22:22:21 / cg" |
|
1046 |
! ! |
|
1047 |
||
1048 |
!Java class methodsFor:'queries'! |
|
1049 |
||
1050 |
smalltalkClassFor:typeRef |
|
1051 |
self halt. |
|
1052 |
"/ (typeString startsWith:'[[') ifTrue:[ |
|
1053 |
"/ ^ Array |
|
1054 |
"/ ]. |
|
1055 |
"/ (typeString startsWith:'[F') ifTrue:[ |
|
1056 |
"/ ^ FloatArray |
|
1057 |
"/ ]. |
|
1058 |
self halt. |
|
1059 |
||
1060 |
"Modified: 7.4.1997 / 13:33:46 / cg" |
|
1061 |
! |
|
1062 |
||
1063 |
smalltalkDerefType:typeString |
|
1064 |
(typeString startsWith:'[') ifTrue:[ |
|
1065 |
^ typeString copyFrom:2 |
|
1066 |
]. |
|
1067 |
self halt. |
|
1068 |
||
1069 |
"Modified: 7.4.1997 / 13:13:24 / cg" |
|
1070 |
! ! |
|
1071 |
||
1072 |
!Java class methodsFor:'registering java classes'! |
|
1073 |
||
1074 |
at:aJavaName |
|
1075 |
"search & return for a class by name; |
|
1076 |
if there is no such class, return nil. |
|
1077 |
The argument, aJavaName may be either an internal name |
|
1078 |
(sep'd by slashes) or an external name (sep'd by periods). |
|
1079 |
The 'java/lang' standard packages prefix may be ommitted." |
|
1080 |
||
1081 |
|sym nm cls| |
|
1082 |
||
1083 |
Classes isNil ifTrue:[^ nil]. |
|
1084 |
||
1085 |
sym := aJavaName asSymbolIfInterned. |
|
1086 |
sym notNil ifTrue:[ |
|
1087 |
cls := Classes at:sym ifAbsent:nil. |
|
1088 |
cls notNil ifTrue:[^ cls]. |
|
1089 |
]. |
|
1090 |
||
1091 |
nm := aJavaName. |
|
1092 |
(nm includes:$.) ifTrue:[ |
|
1093 |
nm := (nm asString copyReplaceAll:$. with:$/). |
|
1094 |
sym := nm asSymbolIfInterned. |
|
1095 |
sym notNil ifTrue:[ |
|
1096 |
cls := Classes at:sym ifAbsent:nil. |
|
1097 |
cls notNil ifTrue:[^ cls]. |
|
1098 |
]. |
|
1099 |
]. |
|
1100 |
||
1101 |
(nm includes:$/) ifFalse:[ |
|
1102 |
"/ |
|
1103 |
"/ try java.lang.Foo |
|
1104 |
"/ |
|
1105 |
nm := 'java/lang/' , nm. |
|
1106 |
sym := nm asSymbolIfInterned. |
|
1107 |
sym notNil ifTrue:[ |
|
1108 |
cls := Classes at:sym ifAbsent:nil. |
|
1109 |
cls notNil ifTrue:[^ cls]. |
|
1110 |
]. |
|
1111 |
]. |
|
1112 |
||
1113 |
^ nil |
|
1114 |
||
1115 |
" |
|
1116 |
Java at:'java/lang/String' |
|
1117 |
Java at:'java.lang.String' |
|
1118 |
Java at:'String' |
|
1119 |
Java at:'System' |
|
1120 |
Java at:'Foo' |
|
1121 |
" |
|
1122 |
||
1123 |
"Modified: / 18.7.1998 / 22:55:16 / cg" |
|
1124 |
! |
|
1125 |
||
1126 |
at:aJavaName put:aJavaClass |
|
1127 |
|nameSymbol oldClass| |
|
1128 |
||
1129 |
Classes isNil ifTrue:[ |
|
1130 |
Classes := IdentityDictionary new. |
|
1131 |
]. |
|
1132 |
||
1133 |
nameSymbol := aJavaName asSymbol. |
|
1134 |
(Classes includesKey:nameSymbol) ifTrue:[ |
|
1135 |
oldClass := Classes at:nameSymbol. |
|
1136 |
oldClass == aJavaClass ifTrue:[ |
|
1137 |
^ self |
|
1138 |
]. |
|
1139 |
('JAVA: class ' , aJavaName , ' is already loaded') infoPrintCR. |
|
1140 |
self updateClassRefsFrom:oldClass to:aJavaClass. |
|
1141 |
]. |
|
1142 |
||
1143 |
Classes at:nameSymbol put:aJavaClass. |
|
1144 |
nameSymbol == #'java/lang/String' ifTrue:[ |
|
1145 |
Java_lang_String := aJavaClass |
|
1146 |
]. |
|
1147 |
||
1148 |
"/ UnresolvedClassRefs notNil ifTrue:[ |
|
1149 |
"/ UnresolvedClassRefs do:[:toResolve | |
|
1150 |
"/ ] |
|
1151 |
"/ ]. |
|
1152 |
||
1153 |
self changed:#classes |
|
1154 |
||
1155 |
"Created: 17.4.1996 / 23:29:31 / cg" |
|
1156 |
"Modified: 7.8.1997 / 19:15:58 / cg" |
|
1157 |
! |
|
1158 |
||
1159 |
flushAllJavaResources |
|
1160 |
self flushClasses. |
|
1161 |
||
1162 |
SourceCache := CacheDictionary new: 32. |
|
1163 |
SourceArchiveCache := CacheDictionary new: 32. |
|
1164 |
||
1165 |
ObjectMemory allObjectsDo:[:someObject | |
|
1166 |
someObject isBehavior ifTrue:[ |
|
1167 |
someObject isJavaClass ifTrue:[ |
|
1168 |
someObject setConstantPool:nil. |
|
1169 |
someObject setInterfaces:nil. |
|
1170 |
someObject setMethodDictionary:(MethodDictionary new). |
|
1171 |
'JAVA [info]: flushing ' print. someObject fullName printCR. |
|
1172 |
] |
|
1173 |
]. |
|
1174 |
]. |
|
1175 |
JavaClass flushClassesInitOrder. |
|
1176 |
||
1177 |
self flushClasses |
|
1178 |
||
1179 |
" |
|
1180 |
Java flushAllJavaResources |
|
1181 |
" |
|
1182 |
||
1183 |
"Modified: / 06-11-2001 / 09:49:37 / cg" |
|
878
b972cc489a01
Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents:
877
diff
changeset
|
1184 |
"Modified: / 26-07-2011 / 17:59:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
752 | 1185 |
! |
1186 |
||
1187 |
flushClasses |
|
1188 |
Classes := UnresolvedClassRefs := nil. |
|
1189 |
Smalltalk keys copy do:[:aKey | |
|
1190 |
(aKey startsWith:'JAVA::') ifTrue:[ Smalltalk removeKey:aKey ] |
|
1191 |
]. |
|
1192 |
Smalltalk removeKey:#'JAVA'. |
|
1193 |
||
1194 |
Java_lang_String := Java_lang_Class := nil. |
|
1195 |
JavaVM releaseAllJavaResources. |
|
1196 |
JavaUnresolvedConstant flushPatchLists. |
|
1197 |
Debugger == DebugView ifTrue:[Debugger newDebugger]. |
|
1198 |
ObjectMemory flushCaches. |
|
1199 |
||
1200 |
" |
|
1201 |
Java flushClasses |
|
1202 |
" |
|
1203 |
||
1204 |
"Modified: / 6.11.2001 / 09:47:49 / cg" |
|
1205 |
! |
|
1206 |
||
1207 |
markAllClassesUninitialized |
|
1208 |
self allClassesDo:[:aJavaClass | |
|
1209 |
aJavaClass markUninitialized |
|
1210 |
]. |
|
1211 |
||
1212 |
" |
|
1213 |
Java markAllClassesUninitialized |
|
1214 |
" |
|
1215 |
! |
|
1216 |
||
1217 |
rememberUnresolved:anUnresolvedClassRef |
|
1218 |
('JAVA: remember unresolved class: ' , anUnresolvedClassRef fullName) infoPrintCR. |
|
1219 |
||
1220 |
UnresolvedClassRefs isNil ifTrue:[ |
|
1221 |
UnresolvedClassRefs := Dictionary new. |
|
1222 |
]. |
|
1223 |
UnresolvedClassRefs |
|
1224 |
at:anUnresolvedClassRef fullName |
|
1225 |
put:anUnresolvedClassRef |
|
1226 |
||
1227 |
"Created: / 18.4.1996 / 00:05:31 / cg" |
|
1228 |
"Modified: / 19.10.1998 / 20:57:44 / cg" |
|
1229 |
! |
|
1230 |
||
1231 |
removeClass:aJavaClass |
|
1232 |
"/ remove it from myself |
|
1233 |
||
1234 |
|javaName sym nm cls p ns| |
|
1235 |
||
1236 |
javaName := aJavaClass fullName. |
|
1237 |
||
1238 |
sym := javaName asSymbolIfInterned. |
|
1239 |
sym notNil ifTrue:[ |
|
1240 |
cls := Classes at:sym ifAbsent:nil. |
|
1241 |
]. |
|
1242 |
cls isNil ifTrue:[ |
|
1243 |
nm := javaName. |
|
1244 |
(nm includes:$.) ifTrue:[ |
|
1245 |
"/ |
|
1246 |
"/ try pckg/.../name |
|
1247 |
"/ |
|
1248 |
nm := (nm asString copyReplaceAll:$. with:$/). |
|
1249 |
sym := nm asSymbolIfInterned. |
|
1250 |
sym notNil ifTrue:[ |
|
1251 |
cls := Classes at:sym ifAbsent:nil. |
|
1252 |
]. |
|
1253 |
]. |
|
1254 |
]. |
|
1255 |
(cls notNil and:[cls == aJavaClass]) ifTrue:[ |
|
1256 |
Classes removeKey:sym. |
|
1257 |
self updateClassRefsFrom:aJavaClass to:nil. |
|
1258 |
]. |
|
1259 |
Smalltalk removeKey:('JAVA::' , javaName) asSymbol. |
|
1260 |
Smalltalk removeKey:javaName asSymbol. |
|
1261 |
Smalltalk removeKey:((javaName , '') copy replaceAll:$/ with:$.) asSymbol. |
|
1262 |
||
1263 |
"/ remove myself from the JAVA::-::-:: namespace |
|
1264 |
"/ (which exists for convenient smalltalk access only) |
|
1265 |
||
1266 |
p := aJavaClass nameSpacePath. |
|
1267 |
p knownAsSymbol ifTrue:[ |
|
1268 |
ns := Smalltalk at:p asSymbol. |
|
1269 |
(ns notNil and:[ns isNameSpace]) ifTrue:[ |
|
1270 |
Smalltalk removeKey:(p , '::' , aJavaClass lastName) asSymbol |
|
1271 |
] |
|
1272 |
]. |
|
1273 |
||
1274 |
"Modified: / 19.10.1998 / 20:58:49 / cg" |
|
1275 |
! |
|
1276 |
||
1277 |
unresolvedClassRefFor:aClassName |
|
1278 |
UnresolvedClassRefs isNil ifTrue:[^ nil]. |
|
1279 |
^ UnresolvedClassRefs at:aClassName ifAbsent:nil. |
|
1280 |
||
1281 |
"Modified: / 19.10.1998 / 20:56:46 / cg" |
|
1282 |
! |
|
1283 |
||
1284 |
updateClassRefsFrom:oldClass to:newClass |
|
1285 |
"update all references to oldClass to now refer to newClass. |
|
1286 |
sent, when a class is reloaded" |
|
1287 |
||
1288 |
newClass notNil ifTrue:[ |
|
1289 |
"/ |
|
1290 |
"/ kludge: the new class might have been resolved with the oldClass ... |
|
1291 |
"/ |
|
1292 |
newClass constantPool |
|
1293 |
updateClassRefsFrom:oldClass to:newClass. |
|
1294 |
]. |
|
1295 |
||
1296 |
self allClassesDo:[:aJavaClass | |
|
1297 |
aJavaClass updateClassRefsFrom:oldClass to:newClass |
|
1298 |
]. |
|
1299 |
||
1300 |
"Created: 26.3.1997 / 13:49:20 / cg" |
|
1301 |
"Modified: 12.8.1997 / 03:04:44 / cg" |
|
1302 |
! ! |
|
1303 |
||
1304 |
!Java class methodsFor:'source management'! |
|
1305 |
||
1306 |
classSource:filename package:package in:dirOrZipFile |
|
1307 |
|fn zar f | |
|
1308 |
||
1309 |
fn := dirOrZipFile asFilename. |
|
1310 |
fn isDirectory |
|
1311 |
ifTrue: |
|
1312 |
[ package notNil |
|
1313 |
ifTrue:[ (f:= fn / package / filename) exists ifTrue:[ ^ f contents asString ]. ]. |
|
1314 |
(f := fn / filename) exists ifTrue:[ ^ f contents asString ]. ] |
|
1315 |
ifFalse: |
|
1316 |
[ (dirOrZipFile last == $p and: [fn hasSuffix:'zip']) |
|
1317 |
ifTrue: |
|
1318 |
[ zar := SourceArchiveCache |
|
1319 |
at: dirOrZipFile |
|
1320 |
ifAbsentPut:[ZipArchive oldFileNamed:fn pathName]. |
|
1321 |
zar notNil |
|
1322 |
ifTrue: |
|
1323 |
[ package notNil |
|
1324 |
ifTrue:[ |
|
1325 |
OperatingSystem fileSeparator ~~ $/ ifTrue: [ |
|
1326 |
f := (package copyReplaceAll: OperatingSystem fileSeparator with: $/) , '/' , filename |
|
1327 |
] ifFalse:[ |
|
1328 |
f := package , '/' , filename. |
|
1329 |
]] |
|
1330 |
ifFalse:[ f := filename]. |
|
1331 |
(zar findMember: f) ifNotNil: |
|
1332 |
[ |
|
1333 |
"Kludge because of broken ZipArchive" |
|
1334 |
| cache | |
|
754 | 1335 |
cache := Java cacheDirectory / Release name / 'src'. |
752 | 1336 |
cache exists ifFalse:[cache recursiveMakeDirectory]. |
1337 |
(cache / f) exists ifTrue:[^(cache / f) contents asString]. |
|
1338 |
OperatingSystem |
|
1339 |
executeCommand:('unzip "%1" "%2"' bindWith: fn asAbsoluteFilename asString |
|
1340 |
with: f asString) |
|
1341 |
inDirectory: cache asString. |
|
1342 |
(f := cache / f) exists ifTrue:[^f contents asString] |
|
1343 |
] |
|
1344 |
]]]. |
|
1345 |
||
1346 |
^ nil |
|
1347 |
||
1348 |
" |
|
1349 |
Java classSource: 'Object.java' package:'java/lang' in:'/home/jv/Projects/JavaX/java-6-openjdk/src' |
|
1350 |
Java classSource: 'Object.java' package:'java/lang' in:'/usr/lib/jvm/java-6-openjdk/src.zip' |
|
1351 |
||
1352 |
" |
|
1353 |
||
1354 |
"Modified: / 29-03-1998 / 21:46:40 / cg" |
|
1355 |
"Created: / 30-11-2010 / 12:32:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
754 | 1356 |
"Modified: / 08-04-2011 / 15:01:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
752 | 1357 |
! |
1358 |
||
1359 |
classSourceOf:aClass |
|
1360 |
|package dirName binary sourceFileName sourceFile loader codeBaseURL protocol codeBaseURLIdx src| |
|
1361 |
||
1362 |
aClass isNil ifTrue:[ |
|
1363 |
^ nil |
|
1364 |
]. |
|
1365 |
"/ look at the cache" |
|
1366 |
SourceCache at: aClass ifPresent: [:src|^src]. |
|
1367 |
||
1368 |
"/ first, look in the directory, where the binary |
|
1369 |
"/ was loaded from. |
|
1370 |
||
1371 |
binary := aClass binaryFile. |
|
1372 |
binary notNil ifTrue:[ |
|
1373 |
binary := binary asFilename. |
|
1374 |
aClass sourceFile notNil ifTrue:[ |
|
1375 |
sourceFileName := binary directory constructString:(aClass sourceFile). |
|
1376 |
sourceFileName asFilename exists ifFalse:[ |
|
1377 |
sourceFileName := nil. |
|
1378 |
] |
|
1379 |
]. |
|
1380 |
sourceFileName isNil ifTrue:[ |
|
1381 |
sourceFileName := binary withSuffix:'java'. |
|
1382 |
]. |
|
1383 |
sourceFile := sourceFileName asFilename. |
|
1384 |
] ifFalse:[ |
|
1385 |
"/ maybe it was loaded by a java classLoader ... |
|
1386 |
(loader := aClass classLoader) notNil ifTrue:[ |
|
1387 |
codeBaseURLIdx := loader class instVarOffsetOf:'codeBaseURL'. |
|
1388 |
codeBaseURLIdx notNil ifTrue:[ |
|
1389 |
(codeBaseURL := loader instVarAt:codeBaseURLIdx) notNil ifTrue:[ |
|
1390 |
(protocol := codeBaseURL instVarNamed:'protocol') notNil ifTrue:[ |
|
1391 |
(Java as_ST_String:protocol) = 'file' ifTrue:[ |
|
1392 |
dirName := Java as_ST_String:(codeBaseURL instVarNamed:'file'). |
|
1393 |
dirName := dirName asFilename. |
|
1394 |
dirName exists ifTrue:[ |
|
1395 |
aClass sourceFile notNil ifTrue:[ |
|
1396 |
sourceFile := sourceFileName := dirName construct:aClass sourceFile. |
|
1397 |
] |
|
1398 |
] |
|
1399 |
] |
|
1400 |
] |
|
1401 |
] |
|
1402 |
] |
|
1403 |
] |
|
1404 |
]. |
|
1405 |
sourceFile notNil ifTrue:[ |
|
1406 |
sourceFile exists ifFalse:[ |
|
1407 |
binary notNil ifTrue:[ |
|
1408 |
sourceFileName := binary withSuffix:'jav'. |
|
1409 |
sourceFile := sourceFileName asFilename. |
|
1410 |
sourceFile exists ifFalse:[ |
|
1411 |
sourceFileName := binary withSuffix:'JAV'. |
|
1412 |
sourceFile := sourceFileName asFilename. |
|
1413 |
sourceFile exists ifFalse:[ |
|
1414 |
sourceFileName := binary withSuffix:'JAVA'. |
|
1415 |
sourceFile := sourceFileName asFilename. |
|
1416 |
]. |
|
1417 |
]. |
|
1418 |
] |
|
1419 |
]. |
|
1420 |
]. |
|
1421 |
||
1422 |
"/ special case: there were multiple classes in a single |
|
1423 |
"/ source file. |
|
1424 |
||
1425 |
(binary notNil and:[aClass sourceFile notNil]) ifTrue:[ |
|
1426 |
binary withoutSuffix baseName ~= aClass sourceFile asFilename withoutSuffix baseName ifTrue:[ |
|
1427 |
'JAVA: trouble extracting fileName: ' infoPrint. |
|
1428 |
binary withoutSuffix baseName print. ' vs. ' infoPrint. |
|
1429 |
aClass sourceFile asFilename withoutSuffix baseName infoPrintCR. |
|
1430 |
]. |
|
1431 |
]. |
|
1432 |
||
1433 |
"/ if that fails, look in standard places |
|
1434 |
||
1435 |
(sourceFile isNil or:[sourceFile exists not]) ifTrue:[ |
|
1436 |
sourceFile := aClass sourceFile. |
|
1437 |
package := aClass javaPackageAsDirname. |
|
1438 |
self effectiveSourceDirectories do:[:dir| |
|
1439 |
src := self classSource: sourceFile package: package in: dir. |
|
1440 |
src ifNotNil:[^src] |
|
1441 |
] |
|
1442 |
||
1443 |
||
1444 |
]. |
|
1445 |
sourceFile isFilename ifFalse:[^nil]. |
|
1446 |
^ (sourceFile contentsOfEntireFile). |
|
1447 |
||
1448 |
" |
|
1449 |
Java classSourceOf: JAVA::java::lang::Object |
|
1450 |
" |
|
1451 |
||
1452 |
"Modified: / 27-01-1999 / 20:40:30 / cg" |
|
1453 |
"Modified: / 10-02-2011 / 23:10:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1454 |
! ! |
|
1455 |
||
1456 |
!Java class methodsFor:'starting apps'! |
|
1457 |
||
1458 |
javaProcessForMainOf:aJavaClass |
|
1459 |
"ask for a commandLine, create a java process to invoke |
|
1460 |
its main and return it. The process is not scheduled for |
|
1461 |
execution." |
|
1462 |
||
1463 |
^ self javaProcessForMainOf:aJavaClass argumentString:nil |
|
1464 |
||
1465 |
"Modified: / 30.12.1998 / 20:24:25 / cg" |
|
1466 |
! |
|
1467 |
||
1468 |
javaProcessForMainOf:aJavaClass argumentString:argStringIn |
|
1469 |
"create a java process, ready to invoke the classes main |
|
1470 |
method. Returns the process - ready to run but not yet resumed" |
|
1471 |
||
1472 |
|p argStringArray argString stdInReplacement alreadyAskedForStdin| |
|
1473 |
||
1474 |
argString := argStringIn. |
|
1475 |
argString isNil ifTrue:[ |
|
1476 |
argString := Dialog |
|
1477 |
request:'argument string:' |
|
1478 |
initialAnswer:LastArgumentString ? '' |
|
1479 |
onCancel:nil. |
|
1480 |
argString isNil ifTrue:[^ nil]. |
|
1481 |
||
1482 |
LastArgumentString := argString. |
|
1483 |
]. |
|
1484 |
||
1485 |
JavaVM initializeVMIfNoEventThreadRunning. |
|
1486 |
(Java at:'java.lang.System') instVarNamed:'security' put:nil. |
|
1487 |
||
1488 |
argString isEmpty ifTrue:[ |
|
1489 |
argStringArray := #() |
|
1490 |
] ifFalse:[ |
|
1491 |
argStringArray := argString asCollectionOfWords collect:[:s | Java as_String:s] as:Array. |
|
1492 |
]. |
|
1493 |
||
1494 |
p := JavaProcess |
|
1495 |
for:[ |
|
1496 |
"/ if the program reads from stdin, let user provide a file |
|
1497 |
"/ for it. |
|
1498 |
JavaVM stdinReplacementFileQuerySignal handle:[:ex | |
|
1499 |
|fn| |
|
1500 |
||
1501 |
alreadyAskedForStdin == true ifFalse:[ |
|
1502 |
fn := Dialog |
|
1503 |
requestFileName:'Program reads from Stdin - give inputFile or cancel for EOF' |
|
1504 |
default:nil |
|
1505 |
fromDirectory:(FileSelectionBox lastFileSelectionDirectory). |
|
1506 |
fn notNil ifTrue:[ |
|
1507 |
stdInReplacement := fn asFilename readStream. |
|
1508 |
]. |
|
1509 |
alreadyAskedForStdin := true. |
|
1510 |
]. |
|
1511 |
ex proceedWith:stdInReplacement |
|
1512 |
] do:[ |
|
1513 |
aJavaClass |
|
1514 |
performStatic:#'main([Ljava/lang/String;)V' |
|
1515 |
with:argStringArray. |
|
1516 |
] |
|
1517 |
] |
|
1518 |
priority:(Processor activePriority - 1). |
|
1519 |
||
1520 |
p name:(aJavaClass fullName , '::main()'). |
|
1521 |
p restartable:true. |
|
1522 |
^ p |
|
1523 |
||
1524 |
"Created: / 15.8.1997 / 04:41:20 / cg" |
|
1525 |
"Modified: / 24.12.1999 / 01:50:21 / cg" |
|
1526 |
! ! |
|
1527 |
||
1528 |
!Java class methodsFor:'documentation'! |
|
1529 |
||
1530 |
version |
|
923 | 1531 |
^ '$Id: Java.st,v 1.134 2011/08/18 18:42:48 vrany Exp $' |
752 | 1532 |
! |
1533 |
||
1534 |
version_SVN |
|
923 | 1535 |
^ '$Id: Java.st,v 1.134 2011/08/18 18:42:48 vrany Exp $' |
1536 |
||
752 | 1537 |
! ! |
1538 |
||
1539 |
Java initialize! |