Java.st
author Claus Gittinger <cg@exept.de>
Wed, 26 Jun 2019 22:06:25 +0200
branchcvs_MAIN
changeset 3918 a7b605e01218
parent 3714 73eaf955ca93
child 3937 18f67facc8dd
permissions -rw-r--r--
#OTHER by cg +bracketStrings
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
454
38f590639d65 *** empty log message ***
cg
parents: 436
diff changeset
     1
"
3324
a58245c0e83a Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3309
diff changeset
     2
 COPYRIGHT (c) 1996-2015 by Claus Gittinger
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
     3
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
     4
 New code and modifications done at SWING Research Group [1]:
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
     5
3324
a58245c0e83a Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3309
diff changeset
     6
 COPYRIGHT (c) 2010-2015 by Jan Vrany, Jan Kurs and Marcel Hlopko
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
     7
			    SWING Research Group, Czech Technical University in Prague
454
38f590639d65 *** empty log message ***
cg
parents: 436
diff changeset
     8
38f590639d65 *** empty log message ***
cg
parents: 436
diff changeset
     9
 This software is furnished under a license and may be used
38f590639d65 *** empty log message ***
cg
parents: 436
diff changeset
    10
 only in accordance with the terms of that license and with the
38f590639d65 *** empty log message ***
cg
parents: 436
diff changeset
    11
 inclusion of the above copyright notice.   This software may not
38f590639d65 *** empty log message ***
cg
parents: 436
diff changeset
    12
 be provided or otherwise made available to, or used by, any
38f590639d65 *** empty log message ***
cg
parents: 436
diff changeset
    13
 other person.  No title to or ownership of the software is
38f590639d65 *** empty log message ***
cg
parents: 436
diff changeset
    14
 hereby transferred.
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
    15
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    16
 [1] Code written at SWING Research Group contains a signature
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    17
     of one of the above copright owners. For exact set of such code,
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    18
     see the differences between this version and version stx:libjava
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    19
     as of 1.9.2010
2088
d654e34676d7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
    20
"
677
63fd7b5d0027 *** empty log message ***
cg
parents: 675
diff changeset
    21
"{ Package: 'stx:libjava' }"
63fd7b5d0027 *** empty log message ***
cg
parents: 675
diff changeset
    22
3384
98eb8443f4f4 Use new Logger API (use Logger severityXXX instead of symbols)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3334
diff changeset
    23
"{ NameSpace: Smalltalk }"
98eb8443f4f4 Use new Logger API (use Logger severityXXX instead of symbols)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3334
diff changeset
    24
17
ea80d8a83063 intitial checkin
cg
parents:
diff changeset
    25
Object subclass:#Java
557
469fe709a779 checkin from browser
cg
parents: 552
diff changeset
    26
	instanceVariableNames:''
3443
d0c9d1873f56 class: Java
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
    27
	classVariableNames:'Initialized Classes UnresolvedClassRefs Release BootBundle
d0c9d1873f56 class: Java
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
    28
		ClassPath ClassPathBundle SourcePath ClassPathExt ExtensionsPath
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    29
		ExtensionsPathPackages CacheDirectory JavaHome InternedStrings
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    30
		Java_lang_String Java_lang_Class PrettyPrintStyle
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    31
		LastArgumentString Threads ExcludedClassPath FailedToLoadClasses
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    32
		SourceCache SourceArchiveCache JavaClassLoaderQuerySignal
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    33
		ClassLoaderQuerySignal ThreadsAccess'
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    34
	poolDictionaries:'JavaVMData'
2108
ca8c4e7db2e8 category change
Claus Gittinger <cg@exept.de>
parents: 2105
diff changeset
    35
	category:'Languages-Java-Support'
17
ea80d8a83063 intitial checkin
cg
parents:
diff changeset
    36
!
ea80d8a83063 intitial checkin
cg
parents:
diff changeset
    37
454
38f590639d65 *** empty log message ***
cg
parents: 436
diff changeset
    38
!Java class methodsFor:'documentation'!
38f590639d65 *** empty log message ***
cg
parents: 436
diff changeset
    39
38f590639d65 *** empty log message ***
cg
parents: 436
diff changeset
    40
copyright
38f590639d65 *** empty log message ***
cg
parents: 436
diff changeset
    41
"
3324
a58245c0e83a Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3309
diff changeset
    42
 COPYRIGHT (c) 1996-2015 by Claus Gittinger
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    43
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    44
 New code and modifications done at SWING Research Group [1]:
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    45
3324
a58245c0e83a Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3309
diff changeset
    46
 COPYRIGHT (c) 2010-2015 by Jan Vrany, Jan Kurs and Marcel Hlopko
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    47
			    SWING Research Group, Czech Technical University in Prague
454
38f590639d65 *** empty log message ***
cg
parents: 436
diff changeset
    48
38f590639d65 *** empty log message ***
cg
parents: 436
diff changeset
    49
 This software is furnished under a license and may be used
38f590639d65 *** empty log message ***
cg
parents: 436
diff changeset
    50
 only in accordance with the terms of that license and with the
38f590639d65 *** empty log message ***
cg
parents: 436
diff changeset
    51
 inclusion of the above copyright notice.   This software may not
38f590639d65 *** empty log message ***
cg
parents: 436
diff changeset
    52
 be provided or otherwise made available to, or used by, any
38f590639d65 *** empty log message ***
cg
parents: 436
diff changeset
    53
 other person.  No title to or ownership of the software is
38f590639d65 *** empty log message ***
cg
parents: 436
diff changeset
    54
 hereby transferred.
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
    55
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    56
 [1] Code written at SWING Research Group contains a signature
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    57
     of one of the above copright owners. For exact set of such code,
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    58
     see the differences between this version and version stx:libjava
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    59
     as of 1.9.2010
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
    60
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
    61
"
3571
33188b3bb660 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
    62
!
33188b3bb660 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
    63
3662
487d86fcee92 #DOCUMENTATION by mawalch
mawalch
parents: 3646
diff changeset
    64
documentation
3571
33188b3bb660 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
    65
"
33188b3bb660 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
    66
    to start the show, evaluate:
33188b3bb660 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
    67
        Java boot
33188b3bb660 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
    68
"
454
38f590639d65 *** empty log message ***
cg
parents: 436
diff changeset
    69
! !
17
ea80d8a83063 intitial checkin
cg
parents:
diff changeset
    70
135
098936234135 *** empty log message ***
cg
parents: 121
diff changeset
    71
!Java class methodsFor:'accessing'!
24
4a9822b95fc0 checkin from browser
cg
parents: 21
diff changeset
    72
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    73
classForName: aString
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    74
    "/JavaVM booted ifFalse:[JavaVM boot].
147
14fc6545fb32 checkin from browser
cg
parents: 146
diff changeset
    75
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    76
    | cls |
340
79f09bb1ac21 remember classes which failed to load - dont try those again.
cg
parents: 324
diff changeset
    77
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    78
    "HACK, required to load extensions methods"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    79
    cls := JavaClassQuery query: (aString copyReplaceAll:$. with: $/).
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    80
    cls isNil ifTrue:[
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    81
	cls := JavaVM classForName: aString.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    82
    ].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    83
    ^cls.
255
2d8b3948a08a *** empty log message ***
cg
parents: 252
diff changeset
    84
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    85
    "Modified: / 08-11-2012 / 00:25:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
147
14fc6545fb32 checkin from browser
cg
parents: 146
diff changeset
    86
!
14fc6545fb32 checkin from browser
cg
parents: 146
diff changeset
    87
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    88
classNamed: aString
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    89
    ^JavaVM classNamed: aString.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    90
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    91
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    92
classRegistry
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    93
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    94
    <resource: #obsolete>
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    95
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    96
    self breakPoint: #mh.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    97
    self breakPoint: #jv.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    98
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
    99
    ^ JavaVM classRegistry.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   100
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   101
    "Modified: / 21-10-2011 / 11:12:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
32
0dbaa43a73db checkin from browser
cg
parents: 27
diff changeset
   102
!
0dbaa43a73db checkin from browser
cg
parents: 27
diff changeset
   103
2093
95430e12670b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
   104
intern:aJavaString
95430e12670b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
   105
    |stString internedString|
95430e12670b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
   106
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   107
    "JV@2012-07-07: We MUST UTF8-encode the string as java.lang.String
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   108
     can keep both normal String and Unicode16String. Therefore it may
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   109
     happen that #intern: gets called once with Java string keeping
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   110
     characters in String and then with a String with same value but
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   111
     characters in Unicode16String.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   112
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   113
     UTF8-encoding ensures that the key is single-byte string
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   114
     and thus #intern: will return the same interned string
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   115
     (actually it return whichever one comes first).
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   116
    "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   117
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   118
    stString := (self as_ST_String:aJavaString) utf8Encoded.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   119
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   120
2093
95430e12670b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
   121
    internedString := InternedStrings at:stString ifAbsent:nil.
95430e12670b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
   122
    internedString isNil ifTrue:[
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   123
	InternedStrings at:stString put:aJavaString.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   124
	internedString := aJavaString
2093
95430e12670b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
   125
    ].
95430e12670b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
   126
    ^ internedString
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   127
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   128
    "Modified: / 07-07-2012 / 22:14:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   129
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   130
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   131
javaExtDirs
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   132
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   133
    ^Java release javaExtDirs
2678
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
   134
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
   135
    "/ JV@2013-08-29: Do not add Smalltalk/X support classes nor groovy nor junit to the
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
   136
    "/                ext path. They are then loaded by *ext* class loader and thus cannot
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
   137
    "/                access classes defined in standard class path (as they are loaded by
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
   138
    "/                system (*app*) class loader.
3233
7bf7a8831ed9 Fixed assertions Java>>removeThread:for:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3214
diff changeset
   139
"/        , (Array
2678
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
   140
"/                with: ((Smalltalk packageDirectoryForPackageId: 'stx:libjava') / 'java' / 'bin')
3233
7bf7a8831ed9 Fixed assertions Java>>removeThread:for:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3214
diff changeset
   141
"/                with: ((Smalltalk packageDirectoryForPackageId: 'stx:libjava') / 'java' / 'libs' / 'ext')
2678
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
   142
"/        ).
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   143
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   144
    "Created: / 31-08-2011 / 22:55:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2678
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
   145
    "Modified (comment): / 29-08-2013 / 00:28:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2093
95430e12670b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
   146
!
95430e12670b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
   147
167
77dcbc4b2201 *** empty log message ***
cg
parents: 162
diff changeset
   148
java_lang_Class
77dcbc4b2201 *** empty log message ***
cg
parents: 162
diff changeset
   149
    Java_lang_Class isNil ifTrue:[
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   150
	Java_lang_Class := self at:'java.lang.Class'
167
77dcbc4b2201 *** empty log message ***
cg
parents: 162
diff changeset
   151
    ].
77dcbc4b2201 *** empty log message ***
cg
parents: 162
diff changeset
   152
    ^ Java_lang_Class
77dcbc4b2201 *** empty log message ***
cg
parents: 162
diff changeset
   153
77dcbc4b2201 *** empty log message ***
cg
parents: 162
diff changeset
   154
    "Created: 26.3.1997 / 13:42:59 / cg"
77dcbc4b2201 *** empty log message ***
cg
parents: 162
diff changeset
   155
    "Modified: 26.3.1997 / 13:46:24 / cg"
77dcbc4b2201 *** empty log message ***
cg
parents: 162
diff changeset
   156
!
77dcbc4b2201 *** empty log message ***
cg
parents: 162
diff changeset
   157
77dcbc4b2201 *** empty log message ***
cg
parents: 162
diff changeset
   158
java_lang_String
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   159
    Java_lang_String isNil ifTrue: [
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   160
	Java_lang_String := JavaVM classNamed: 'java/lang/String'.
167
77dcbc4b2201 *** empty log message ***
cg
parents: 162
diff changeset
   161
    ].
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   162
    ^ Java_lang_String.
167
77dcbc4b2201 *** empty log message ***
cg
parents: 162
diff changeset
   163
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   164
    "Created: / 26-03-1997 / 13:43:17 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   165
    "Modified: / 21-10-2011 / 13:41:02 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
76
9ff95e14dbfb *** empty log message ***
cg
parents: 71
diff changeset
   166
!
9ff95e14dbfb *** empty log message ***
cg
parents: 71
diff changeset
   167
188
5de467ea7e45 support color printing
cg
parents: 176
diff changeset
   168
prettyPrintStyle
3443
d0c9d1873f56 class: Java
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   169
    PrettyPrintStyle isNil ifTrue:[
d0c9d1873f56 class: Java
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   170
        self initializePrettyPrintStyle
d0c9d1873f56 class: Java
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   171
    ].
188
5de467ea7e45 support color printing
cg
parents: 176
diff changeset
   172
    ^ PrettyPrintStyle
5de467ea7e45 support color printing
cg
parents: 176
diff changeset
   173
5de467ea7e45 support color printing
cg
parents: 176
diff changeset
   174
    "Created: 1.8.1997 / 10:37:57 / cg"
248
964ad5f9e8bc no reinit - multiple browsers
cg
parents: 241
diff changeset
   175
!
964ad5f9e8bc no reinit - multiple browsers
cg
parents: 241
diff changeset
   176
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   177
release
2376
b6007a062b1e class: Java
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
   178
    Release isNil ifTrue:[
b6007a062b1e class: Java
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
   179
        self initializeRelease
b6007a062b1e class: Java
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
   180
    ].
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   181
    ^Release
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   182
2461
6a18911097be class: Java
Claus Gittinger <cg@exept.de>
parents: 2396
diff changeset
   183
    "
6a18911097be class: Java
Claus Gittinger <cg@exept.de>
parents: 2396
diff changeset
   184
     Release := nil
6a18911097be class: Java
Claus Gittinger <cg@exept.de>
parents: 2396
diff changeset
   185
    "
6a18911097be class: Java
Claus Gittinger <cg@exept.de>
parents: 2396
diff changeset
   186
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   187
    "Created: / 22-11-2010 / 12:38:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   188
!
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   189
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   190
release: aJavaRelease
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   191
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   192
    Release := aJavaRelease.
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   193
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   194
    "
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   195
	Java release: JavaRelease openJDK6.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   196
	Java release: JavaRelease sunJDK6.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   197
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   198
    "
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   199
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   200
    "Created: / 22-11-2010 / 12:38:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   201
    "Modified: / 15-01-2013 / 17:59:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   202
!
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   203
538
6e695c5be20a checkin from browser
cg
parents: 527
diff changeset
   204
systemPropertyAt:key put:something
6e695c5be20a checkin from browser
cg
parents: 527
diff changeset
   205
    JavaVM systemProperties at:key put:something
6e695c5be20a checkin from browser
cg
parents: 527
diff changeset
   206
6e695c5be20a checkin from browser
cg
parents: 527
diff changeset
   207
    "Created: / 9.1.1999 / 14:49:35 / cg"
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   208
! !
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   209
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   210
!Java class methodsFor:'change & update'!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   211
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   212
update: what with: param from: sender
538
6e695c5be20a checkin from browser
cg
parents: 527
diff changeset
   213
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   214
    what == #restarted ifTrue:[
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   215
	self reinitialize.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   216
    ]
248
964ad5f9e8bc no reinit - multiple browsers
cg
parents: 241
diff changeset
   217
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   218
    "Created: / 14-12-2010 / 21:00:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
192
80dde7b3cd73 checkin from browser
cg
parents: 191
diff changeset
   219
! !
80dde7b3cd73 checkin from browser
cg
parents: 191
diff changeset
   220
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   221
!Java class methodsFor:'class initialization'!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   222
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   223
boot
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   224
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   225
    ^JavaVM boot.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   226
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   227
    "Created: / 21-02-2012 / 18:10:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   228
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   229
2909
2fae1fd966be Added JavaRelease>>system which uses default system Java installation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   230
defaultRelease
3296
761c7bb5853c Java settings cleanup (part 2): release settings refactored.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3275
diff changeset
   231
    | nm release |
2909
2fae1fd966be Added JavaRelease>>system which uses default system Java installation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   232
2fae1fd966be Added JavaRelease>>system which uses default system Java installation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   233
    "First, consult STX_LIBJAVA_RELEASE environment variable, if set"
2fae1fd966be Added JavaRelease>>system which uses default system Java installation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   234
    nm := OperatingSystem getEnvironment:'STX_LIBJAVA_RELEASE'.
2fae1fd966be Added JavaRelease>>system which uses default system Java installation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   235
    nm isNil ifTrue:[
3296
761c7bb5853c Java settings cleanup (part 2): release settings refactored.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3275
diff changeset
   236
        | home |
761c7bb5853c Java settings cleanup (part 2): release settings refactored.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3275
diff changeset
   237
761c7bb5853c Java settings cleanup (part 2): release settings refactored.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3275
diff changeset
   238
        home := UserPreferences current javaHome.
761c7bb5853c Java settings cleanup (part 2): release settings refactored.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3275
diff changeset
   239
        home notEmptyOrNil ifTrue:[ 
761c7bb5853c Java settings cleanup (part 2): release settings refactored.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3275
diff changeset
   240
            release := JavaRelease inDirectory: home.
761c7bb5853c Java settings cleanup (part 2): release settings refactored.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3275
diff changeset
   241
            release notNil ifTrue:[ ^ release ]
761c7bb5853c Java settings cleanup (part 2): release settings refactored.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3275
diff changeset
   242
        ].
2909
2fae1fd966be Added JavaRelease>>system which uses default system Java installation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   243
    ].
2fae1fd966be Added JavaRelease>>system which uses default system Java installation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   244
    nm notNil ifTrue:[
2fae1fd966be Added JavaRelease>>system which uses default system Java installation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   245
        release := JavaRelease perform: nm asSymbol ifNotUnderstood:[nil].
2fae1fd966be Added JavaRelease>>system which uses default system Java installation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   246
    ].
2fae1fd966be Added JavaRelease>>system which uses default system Java installation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   247
    release notNil ifTrue:[ ^ release ].
2fae1fd966be Added JavaRelease>>system which uses default system Java installation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   248
2fae1fd966be Added JavaRelease>>system which uses default system Java installation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   249
    release := JavaRelease system.
3431
82790b1e6d54 Merged with mercurial revision 4f3cc813be4 (8 changesets total)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3430
diff changeset
   250
    "/ Java8 is not yet supported, it's here just for experiments...
82790b1e6d54 Merged with mercurial revision 4f3cc813be4 (8 changesets total)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3430
diff changeset
   251
    (release notNil and:[release isJava8 not]) ifTrue:[ ^ release ].
2909
2fae1fd966be Added JavaRelease>>system which uses default system Java installation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   252
2fae1fd966be Added JavaRelease>>system which uses default system Java installation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   253
    release := JavaRelease default.
2fae1fd966be Added JavaRelease>>system which uses default system Java installation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   254
    ^ release
2fae1fd966be Added JavaRelease>>system which uses default system Java installation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   255
2fae1fd966be Added JavaRelease>>system which uses default system Java installation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   256
2fae1fd966be Added JavaRelease>>system which uses default system Java installation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   257
2fae1fd966be Added JavaRelease>>system which uses default system Java installation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   258
    "
2fae1fd966be Added JavaRelease>>system which uses default system Java installation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   259
    Java defaultRelease.
2fae1fd966be Added JavaRelease>>system which uses default system Java installation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   260
2fae1fd966be Added JavaRelease>>system which uses default system Java installation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   261
    "
2fae1fd966be Added JavaRelease>>system which uses default system Java installation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   262
2fae1fd966be Added JavaRelease>>system which uses default system Java installation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   263
    "Created: / 11-11-2013 / 16:13:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3431
82790b1e6d54 Merged with mercurial revision 4f3cc813be4 (8 changesets total)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3430
diff changeset
   264
    "Modified: / 11-03-2015 / 12:33:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2909
2fae1fd966be Added JavaRelease>>system which uses default system Java installation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   265
!
2fae1fd966be Added JavaRelease>>system which uses default system Java installation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   266
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   267
initAllClasses
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   268
    | system |
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   269
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   270
    FailedToLoadClasses := nil.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   271
    self initAllStaticFields.
2678
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
   272
    system := JavaVM classForName:'java.lang.System' definedBy:nil.
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   273
    system isInitialized ifFalse: [ self initSystemClass. ].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   274
    self allClassesDo: [:cls | cls isInitialized ifFalse: [ cls classInit ] ]
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   275
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   276
    "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   277
     Java initAllClasses"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   278
    "Modified: / 27.11.1998 / 00:33:05 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   279
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   280
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   281
initAllStaticFields
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   282
     self allClassesDo:[:cls |
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   283
	cls initializeStaticFields
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   284
     ]
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   285
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   286
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   287
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   288
initSystemClass
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   289
    | system |
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   290
2678
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
   291
    system := JavaVM classForName:'java.lang.System' definedBy:nil.
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   292
    system isNil ifTrue: [
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   293
	"/        JavaVM initializeVM.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   294
	"/        system := Java at:'java.lang.System'.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   295
	"/        system isNil ifTrue:[
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   296
	self warn: 'JavaVM: no ''' , 'java.lang.System' allBold , ''' class.'.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   297
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   298
"/            self error:'no ''java.lang.System'' class'.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   299
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   300
	^
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   301
"/        ].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   302
	self
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   303
    ].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   304
    system classInit.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   305
    (system implements: #'initializeSystemClass()V') ifTrue: [
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   306
	system "invokeStatic:" perform: #'initializeSystemClass()V'.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   307
    ].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   308
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   309
    "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   310
     Java initSystemClass
192
80dde7b3cd73 checkin from browser
cg
parents: 191
diff changeset
   311
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   312
     (Java at:'java.lang.System')
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   313
	perform:#'getProperty(Ljava/lang/String;)Ljava/lang/String;'
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   314
	with:(Java as_String:'java.home')"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   315
    "Modified: / 10.11.1998 / 12:39:58 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   316
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   317
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   318
initialize
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   319
    | flag |
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   320
3443
d0c9d1873f56 class: Java
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   321
    Initialized == nil ifTrue:[
d0c9d1873f56 class: Java
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   322
        "/ only do this if reinitialized!!
d0c9d1873f56 class: Java
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   323
        Initialized := true.
d0c9d1873f56 class: Java
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   324
    ] ifFalse:[
d0c9d1873f56 class: Java
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   325
        JavaNativeMethod flushAllCachedNativeMethods.
d0c9d1873f56 class: Java
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   326
    ].
d0c9d1873f56 class: Java
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   327
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   328
    InternedStrings := Dictionary new.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   329
    FailedToLoadClasses := nil.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   330
    ClassPathExt := nil.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   331
    ExcludedClassPath := OrderedCollection new.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   332
    SourceCache := CacheDictionary new: 32.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   333
    SourceArchiveCache := CacheDictionary new: 32.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   334
3241
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   335
    "/ Sigh, check for the very first initialization...
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   336
    Threads isNil ifTrue:[
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   337
        ThreadsAccess := RecursionLock forMutualExclusion.
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   338
        Threads := IdentityDictionary new.
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   339
    ].
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   340
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   341
    ClassPathBundle := JavaClassPathBundle new.
2396
fadc6d7a2f5b Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2376
diff changeset
   342
    ClassPath isNil ifTrue:[ClassPath:= OrderedCollection new]. "/ for ad-hoc packages
fadc6d7a2f5b Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2376
diff changeset
   343
    SourcePath isNil ifTrue:[SourcePath := OrderedCollection new]."/ for ad-hoc packages
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   344
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   345
    ThreadsAccess := RecursionLock forMutualExclusion.
3443
d0c9d1873f56 class: Java
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   346
    "/ self initializePrettyPrintStyle. -- done in getter
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   347
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   348
    "Initialize JITer and Native method optimization"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   349
    (flag := OperatingSystem getEnvironment:'STX_LIBJAVA_ENABLE_JIT') notNil ifTrue:[
3233
7bf7a8831ed9 Fixed assertions Java>>removeThread:for:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3214
diff changeset
   350
        ObjectMemory javaJustInTimeCompilation: (flag = '1')
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   351
    ].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   352
    (flag := OperatingSystem getEnvironment:'STX_LIBJAVA_ENABLE_NATIVE_METHOD_OPTIMIZATION') notNil ifTrue:[
3233
7bf7a8831ed9 Fixed assertions Java>>removeThread:for:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3214
diff changeset
   353
        ObjectMemory javaNativeCodeOptimization: (flag = '1')
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   354
    ].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   355
3443
d0c9d1873f56 class: Java
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   356
    ObjectMemory addDependent: self.
d0c9d1873f56 class: Java
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   357
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   358
    "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   359
     Java flushAllJavaResources.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   360
     Java initialize.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   361
     JavaVM initializeVM
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   362
     Java classPath inspect"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   363
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   364
    "Modified: / 06-11-2001 / 09:24:12 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   365
    "Created: / 03-10-2010 / 15:54:02 / Jan Kurs <kurs.jan@post.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   366
    "Modified: / 15-10-2010 / 17:37:20 / Jan Kurs <kurs.jan@post.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   367
    "Modified: / 09-12-2011 / 13:16:15 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
3241
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   368
    "Modified: / 18-09-2014 / 13:47:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   369
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   370
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   371
initializePrettyPrintStyle
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   372
    PrettyPrintStyle := IdentityDictionary new.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   373
    PrettyPrintStyle  at:#accessAttribute put:(#color -> (Color red:0 green:0 blue:25)).
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   374
    PrettyPrintStyle  at:#className       put:(Array with:(#color -> Color black) with:#bold).
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   375
    PrettyPrintStyle  at:#methodName      put:(Array with:(#color -> Color black) with:#bold).
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   376
    PrettyPrintStyle  at:#code            put:(#color -> Color black).
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   377
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   378
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   379
     "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   380
      Java initializePrettyPrintStyle
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   381
     "
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   382
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   383
    "Created: 1.8.1997 / 11:08:43 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   384
    "Modified: 1.8.1997 / 11:09:58 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   385
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   386
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   387
initializeRelease
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   388
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   389
    Release isNil ifTrue:[
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   390
	self reinitializeRelease.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   391
    ].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   392
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   393
    "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   394
	Release := nil.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   395
	self initializeRelease.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   396
	Release
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   397
    "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   398
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   399
    "Created: / 22-11-2010 / 13:41:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   400
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   401
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   402
reboot
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   403
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   404
    ^JavaVM reboot.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   405
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   406
    "Created: / 21-02-2012 / 18:11:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   407
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   408
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   409
reinitAllClasses
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   410
     self markAllClassesUninitialized.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   411
     self initAllClasses
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   412
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   413
     "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   414
      Java reinitAllClasses
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   415
     "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   416
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   417
    "Modified: / 4.1.1998 / 00:34:29 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   418
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   419
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   420
reinitialize
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   421
    FailedToLoadClasses := nil.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   422
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   423
    "Kludge"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   424
    JavaMethod reinitialize.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   425
    JavaMethodWithException reinitialize.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   426
    JavaMethodWithHandler reinitialize.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   427
    JavaNativeMethod reinitialize.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   428
    JavaNativeMethod flushAllCachedNativeMethods.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   429
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   430
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   431
    "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   432
     Java reinitialize
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   433
    "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   434
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   435
    "Created: / 26-08-1997 / 20:07:00 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   436
    "Modified: / 27-04-1998 / 14:57:23 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   437
    "Modified: / 17-08-2012 / 11:58:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   438
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   439
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   440
reinitializeRelease
192
80dde7b3cd73 checkin from browser
cg
parents: 191
diff changeset
   441
2909
2fae1fd966be Added JavaRelease>>system which uses default system Java installation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   442
    Release := self defaultRelease.
2fae1fd966be Added JavaRelease>>system which uses default system Java installation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   443
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   444
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   445
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   446
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   447
    "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   448
        Release := nil.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   449
        self initializeRelease.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   450
        Release
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   451
    "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   452
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   453
    "Created: / 26-07-2012 / 23:58:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2909
2fae1fd966be Added JavaRelease>>system which uses default system Java installation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2841
diff changeset
   454
    "Modified: / 11-11-2013 / 16:13:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   455
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   456
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   457
startupJavaSystem
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   458
    | javaEventThread  haveEventThread  haveScreenUpdater |
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   459
    FailedToLoadClasses := nil.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   460
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   461
    "/
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   462
    "/ check if already running
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   463
    "/
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   464
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   465
    haveEventThread := true.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   466
    javaEventThread := JavaVM javaEventThread.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   467
    (javaEventThread isNil or: [ javaEventThread isDead ]) ifTrue: [
3385
58d72cc6d5f6 Replaced old-style `'string' infoPrintCR` logging with new-style `Logger log:'string'` logging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3384
diff changeset
   468
        haveEventThread := false
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   469
    ].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   470
    haveScreenUpdater := false.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   471
    haveEventThread ifTrue: [
3385
58d72cc6d5f6 Replaced old-style `'string' infoPrintCR` logging with new-style `Logger log:'string'` logging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3384
diff changeset
   472
        self threadsDo: [
58d72cc6d5f6 Replaced old-style `'string' infoPrintCR` logging with new-style `Logger log:'string'` logging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3384
diff changeset
   473
            :aJavaThread |
58d72cc6d5f6 Replaced old-style `'string' infoPrintCR` logging with new-style `Logger log:'string'` logging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3384
diff changeset
   474
            aJavaThread name = 'JAVA-Screen Updater' ifTrue: [
58d72cc6d5f6 Replaced old-style `'string' infoPrintCR` logging with new-style `Logger log:'string'` logging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3384
diff changeset
   475
                aJavaThread isDead ifFalse: [
58d72cc6d5f6 Replaced old-style `'string' infoPrintCR` logging with new-style `Logger log:'string'` logging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3384
diff changeset
   476
                    "/ already running
58d72cc6d5f6 Replaced old-style `'string' infoPrintCR` logging with new-style `Logger log:'string'` logging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3384
diff changeset
   477
                    haveScreenUpdater := true
58d72cc6d5f6 Replaced old-style `'string' infoPrintCR` logging with new-style `Logger log:'string'` logging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3384
diff changeset
   478
                ]
58d72cc6d5f6 Replaced old-style `'string' infoPrintCR` logging with new-style `Logger log:'string'` logging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3384
diff changeset
   479
            ]
58d72cc6d5f6 Replaced old-style `'string' infoPrintCR` logging with new-style `Logger log:'string'` logging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3384
diff changeset
   480
        ].
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   481
    ].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   482
    (haveEventThread and: [ haveScreenUpdater ]) ifTrue: [ ^ self ].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   483
    JavaClass orderOfClassInits isNil ifTrue: [
3385
58d72cc6d5f6 Replaced old-style `'string' infoPrintCR` logging with new-style `Logger log:'string'` logging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3384
diff changeset
   484
        "/ the very first start ...
58d72cc6d5f6 Replaced old-style `'string' infoPrintCR` logging with new-style `Logger log:'string'` logging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3384
diff changeset
   485
        Logger log: 'JAVA [info]: (re)initializing JAVA environment completely ...' severity: Logger severityDEBUG facility: #JVM.
58d72cc6d5f6 Replaced old-style `'string' infoPrintCR` logging with new-style `Logger log:'string'` logging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3384
diff changeset
   486
58d72cc6d5f6 Replaced old-style `'string' infoPrintCR` logging with new-style `Logger log:'string'` logging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3384
diff changeset
   487
        JavaVM initializeVM.
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   488
    ] ifFalse: [ JavaVM initializeVMIfNoEventThreadRunning ].
3385
58d72cc6d5f6 Replaced old-style `'string' infoPrintCR` logging with new-style `Logger log:'string'` logging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3384
diff changeset
   489
    Logger log: 'JAVA [info]: done JAVA initialization.' severity: Logger severityDEBUG facility: #JVM                         .
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   490
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   491
    "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   492
     Java startupJavaSystem"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   493
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   494
    "Modified: / 24-12-1999 / 01:37:49 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   495
    "Modified: / 09-12-2011 / 12:50:00 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
3385
58d72cc6d5f6 Replaced old-style `'string' infoPrintCR` logging with new-style `Logger log:'string'` logging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3384
diff changeset
   496
    "Modified: / 02-03-2015 / 16:03:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   497
!
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   498
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   499
terminateAllThreads
3241
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   500
    "Terminates all pure Java threads (i.e., threads created by the JVM."
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   501
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   502
    | myself  threadsToKill  semaphore |
3241
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   503
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   504
    Threads isEmptyOrNil  ifTrue: [ ^ self ].
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   505
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   506
    myself := Processor activeProcess.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   507
    threadsToKill := IdentitySet new.
3241
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   508
    ThreadsAccess critical:[
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   509
        Threads do: [:aJavaThread |
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   510
            aJavaThread ~~ myself ifTrue: [
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   511
                "/ What's the aim of the check below? Looks like a check for weak corpse (object's gone)
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   512
                "/ but Threads is not a weak dictionary!!
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   513
                "/ (aJavaThread isNil or: [ aJavaThread == 0 ]) ifFalse: [
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   514
                    (aJavaThread isDead not and:[aJavaThread isMemberOf: JavaProcess]) ifTrue: [
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   515
                        threadsToKill add: aJavaThread 
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   516
                    ]
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   517
                "/ ]
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   518
            ]
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   519
        ].
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   520
    ].
3241
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   521
    threadsToKill notEmptyOrNil ifTrue: [
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   522
        Logger
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   523
            log: 'Killing ' , threadsToKill size printString , ' java processes'
3384
98eb8443f4f4 Use new Logger API (use Logger severityXXX instead of symbols)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3334
diff changeset
   524
            severity:Logger severityDEBUG
3241
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   525
            facility: #JVM.
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   526
        semaphore := Semaphore new: 1 - threadsToKill size.
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   527
        semaphore name: 'Java thread killer'.
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   528
        threadsToKill do: [ :aThread |
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   529
            aThread == JavaVM javaScreenUpdaterThread ifTrue: [ self halt ].
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   530
            aThread == JavaVM javaEventQueueThread ifTrue: [ self halt ].
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   531
            aThread
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   532
                addExitAction: [
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   533
                    Logger
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   534
                        log: 'Java thread killed successfully'
3384
98eb8443f4f4 Use new Logger API (use Logger severityXXX instead of symbols)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3334
diff changeset
   535
                        severity: Logger severityDEBUG
3241
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   536
                        facility: #JVM.
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   537
                    semaphore signal
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   538
                ].
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   539
            aThread terminate
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   540
        ].
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   541
        semaphore wait.
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   542
    ].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   543
    JavaVM releaseAllMonitors.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   544
    Logger
3241
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   545
        log: 'No Java threads running at this point'
3384
98eb8443f4f4 Use new Logger API (use Logger severityXXX instead of symbols)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3334
diff changeset
   546
        severity: Logger severityDEBUG
3241
422e32abb28d Fix in Java: do not flush Threads dictionary when rebooting JVM
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3233
diff changeset
   547
        facility: #JVM.
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   548
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   549
    "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   550
     Java terminateAllThreads"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   551
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   552
    "Created: / 26-08-1997 / 19:57:40 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   553
    "Modified: / 24-12-1999 / 02:34:53 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   554
    "Modified: / 17-11-2011 / 21:31:14 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
3384
98eb8443f4f4 Use new Logger API (use Logger severityXXX instead of symbols)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3334
diff changeset
   555
    "Modified: / 02-03-2015 / 14:10:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   556
! !
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   557
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   558
!Java class methodsFor:'debugging'!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   559
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   560
dontHaltOnKnownBugs
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   561
    Object disableBreakPoint: #knownBugs.
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   562
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   563
    "Created: / 09-10-2011 / 17:29:17 / m"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   564
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   565
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   566
dumpConfig
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   567
    Transcript notNil ifTrue:[
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   568
        self dumpConfigOn: Transcript
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   569
    ] ifFalse:[
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   570
        self dumpConfigOn: Stdout
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   571
    ]
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   572
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   573
    "Created: / 10-12-2011 / 12:54:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   574
    "Modified (format): / 11-02-2013 / 14:18:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   575
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   576
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   577
dumpConfigKey: key value: value on: stream
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   578
    '%-30s : %s' printf: { key . value } on: stream.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   579
    stream cr.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   580
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   581
    "Created: / 08-02-2013 / 10:18:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   582
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   583
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   584
dumpConfigOn: stream
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   585
    "Prints current config (java home, initial system properties etc) on a stream."
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   586
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   587
    | props |
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   588
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   589
    stream nextPutAll: '== VM configuration =='; cr.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   590
    self dumpConfigKey: 'JIT' value: (ObjectMemory javaJustInTimeCompilation printString) on: stream.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   591
    self dumpConfigKey: 'Native Opt' value: (ObjectMemory javaNativeCodeOptimization printString) on: stream.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   592
    Java release dumpConfigOn: stream.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   593
    props := Dictionary new.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   594
    JavaVM initializeSystemPropertiesInto: props.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   595
    stream nextPutAll: '== Initial system properties =='; cr.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   596
    props keysAndValuesDo:[:key :value|
3233
7bf7a8831ed9 Fixed assertions Java>>removeThread:for:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3214
diff changeset
   597
        self dumpConfigKey: key value: value on: stream.
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   598
    ].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   599
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   600
    "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   601
        Java dumpConfigOn: Transcript.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   602
    "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   603
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   604
    "Created: / 10-12-2011 / 12:54:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   605
    "Modified: / 08-02-2013 / 10:23:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   606
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   607
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   608
haltOnKnownBugs
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   609
    Object enableBreakPoint: #knownBugs.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   610
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   611
    "Created: / 09-10-2011 / 17:29:05 / m"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   612
! !
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   613
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   614
!Java class methodsFor:'enumerating'!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   615
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   616
allClasses
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   617
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   618
    ^JavaVM classRegistry classes
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   619
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   620
    "Modified: / 28-01-1998 / 01:42:04 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   621
    "Modified: / 23-10-2011 / 20:14:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   622
!
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   623
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   624
allClassesDo:aBlock
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   625
3067
4bbacafb9592 Renamed JavaClassRegistry>>classesDo: to allClassesDo:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2967
diff changeset
   626
    ^JavaVM classRegistry allClassesDo: aBlock
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   627
3067
4bbacafb9592 Renamed JavaClassRegistry>>classesDo: to allClassesDo:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2967
diff changeset
   628
    "Modified: / 09-04-2014 / 18:43:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   629
! !
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   630
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   631
!Java class methodsFor:'object conversions'!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   632
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   633
as_Boolean:aBoolean
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   634
    "convert an ST-boolean into a Java Boolean"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   635
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   636
    |i|
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   637
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   638
    i := (Java at:'java.lang.Boolean') new.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   639
    i perform:#'<init>(Z)V' with:(aBoolean ifTrue:[1] ifFalse:[0]).
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   640
    ^ i
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   641
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   642
    "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   643
     Java as_Boolean: true
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   644
     Java as_Boolean: false
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   645
    "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   646
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   647
    "Created: / 26-12-2011 / 20:44:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   648
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   649
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   650
as_Float:aNumber
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   651
    "convert an ST-float into a Java Float"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   652
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   653
    |i|
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   654
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   655
    i := (Java at:'java.lang.Float') new.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   656
    i perform:#'<init>(F)V' with:(aNumber asShortFloat).
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   657
    ^ i
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   658
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   659
    "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   660
     Java as_Float:1
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   661
     Java as_Float:3.14159
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   662
    "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   663
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   664
    "Created: 7.8.1997 / 21:21:13 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   665
    "Modified: 7.8.1997 / 21:22:05 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   666
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   667
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   668
as_Hashtable: aDictionary
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   669
    "given a smalltalk dictionary, create and return
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   670
     a Java hashTable for it"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   671
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   672
    | hashTable |
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   673
2678
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
   674
    hashTable := (JavaVM classForName:'java.util.Hashtable' definedBy:nil) new.
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   675
    aDictionary
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   676
	keysAndValuesDo: [
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   677
	    :k :v |
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   678
	    | sk  sv  jk  jv |
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   679
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   680
	    (sk := k) isSymbol ifTrue: [ sk := sk asString ].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   681
	    (sv := v) isSymbol ifTrue: [ sv := sv asString ].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   682
	    jk := self as_Object: sk.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   683
	    jv := self as_Object: sv.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   684
	    hashTable
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   685
		perform: #'put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;'
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   686
		with: jk
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   687
		with: jv.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   688
	].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   689
    ^ hashTable
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   690
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   691
    "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   692
     Java as_Hashtable:(Dictionary new
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   693
			   at:'hello' put:'Hallo';
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   694
			   at:'world' put:'Welt';
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   695
			   yourself)"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   696
    "Modified: / 14.1.1998 / 17:02:13 / cg"
192
80dde7b3cd73 checkin from browser
cg
parents: 191
diff changeset
   697
!
80dde7b3cd73 checkin from browser
cg
parents: 191
diff changeset
   698
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   699
as_Integer:anInteger
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   700
    "convert an ST-integer into a Java Integer"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   701
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   702
    |i|
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   703
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   704
    i := (Java at:'java.lang.Integer') new.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   705
    i perform:#'<init>(I)V' with:anInteger.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   706
    ^ i
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   707
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   708
    "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   709
     Java as_Integer:1
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   710
    "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   711
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   712
    "Modified: 7.8.1997 / 21:19:37 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   713
    "Created: 7.8.1997 / 21:21:13 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   714
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   715
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   716
as_Object:anObject
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   717
    "convert an ST-Object into a Java Object"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   718
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   719
    anObject isString ifTrue:[
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   720
	^ self as_String:anObject
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   721
    ].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   722
    anObject isInteger ifTrue:[
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   723
	^ self as_Integer:anObject
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   724
    ].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   725
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   726
    self halt.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   727
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   728
    "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   729
     Java as_Object:'hello world'
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   730
    "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   731
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   732
    "Created: 7.8.1997 / 21:15:38 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   733
    "Modified: 7.8.1997 / 21:20:07 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   734
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   735
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   736
as_ST_String: aJavaString
3714
73eaf955ca93 #OTHER by mawalch
mawalch
parents: 3707
diff changeset
   737
    "Given a java.lang.String instance, returns a corresponding
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   738
     Smalltalk String"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   739
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   740
    ^Release as_ST_String: aJavaString
198
5543d1079a4a *** empty log message ***
cg
parents: 192
diff changeset
   741
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   742
    "Created: / 08-08-1997 / 12:02:55 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   743
    "Modified: / 04-01-1999 / 23:55:08 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   744
    "Modified: / 22-03-2011 / 17:21:19 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   745
    "Modified: / 07-02-2013 / 20:02:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3714
73eaf955ca93 #OTHER by mawalch
mawalch
parents: 3707
diff changeset
   746
    "Modified (comment): / 22-05-2017 / 14:10:18 / mawalch"
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   747
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   748
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   749
as_String:aString
3662
487d86fcee92 #DOCUMENTATION by mawalch
mawalch
parents: 3646
diff changeset
   750
    "Given a Smalltalk string, returns corresponding instance of
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   751
     java.lang.String"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   752
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   753
    ^Release as_String: aString
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   754
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   755
    "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   756
     Java as_String:'hello world'
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   757
    "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   758
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   759
    "Created: / 07-08-1997 / 21:15:49 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   760
    "Modified: / 07-02-2013 / 20:03:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   761
!
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   762
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   763
as_URL:aString
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   764
    "convert an ST-String into a Java String"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   765
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   766
    "hard-coding internas of java.lang.String here is bad ..."
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   767
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   768
    |u s|
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   769
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   770
    s := aString.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   771
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   772
    "/ kludge for volume
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   773
    OperatingSystem isMSDOSlike ifTrue:[
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   774
	((s size > 1) and:[(s at:2) == $:]) ifTrue:[
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   775
	    s := 'file:' , (s copy at:2 put:$|)
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   776
	]
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   777
    ].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   778
    u := (self at:'java.net.URL') newCleared.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   779
    u perform:#'<init>(Ljava/lang/String;)V' with:(self as_String:s).
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   780
    ^ u
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   781
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   782
    "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   783
     Java as_URL:'http://www.altavista.com'
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   784
     Java as_URL:'file:/foo/bar'
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   785
    "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   786
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   787
    "Created: / 7.8.1997 / 21:15:49 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   788
    "Modified: / 25.9.1999 / 22:22:21 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   789
! !
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   790
2396
fadc6d7a2f5b Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2376
diff changeset
   791
!Java class methodsFor:'others'!
fadc6d7a2f5b Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2376
diff changeset
   792
fadc6d7a2f5b Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2376
diff changeset
   793
version_HG
fadc6d7a2f5b Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2376
diff changeset
   794
2633
09033fe349f5 class: Java
Claus Gittinger <cg@exept.de>
parents: 2474
diff changeset
   795
    ^ '$Changeset: <not expanded> $'
2396
fadc6d7a2f5b Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2376
diff changeset
   796
! !
fadc6d7a2f5b Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2376
diff changeset
   797
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   798
!Java class methodsFor:'paths-accessing'!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   799
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   800
cacheDirectory
3196
d617b4590431 (Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3098
diff changeset
   801
    CacheDirectory isNil ifTrue:[
3233
7bf7a8831ed9 Fixed assertions Java>>removeThread:for:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3214
diff changeset
   802
        CacheDirectory := Filename homeDirectory / '.smalltalk' / 'libjava'
7bf7a8831ed9 Fixed assertions Java>>removeThread:for:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3214
diff changeset
   803
                / 'caches'
3196
d617b4590431 (Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3098
diff changeset
   804
                    / (((Smalltalk at:#'stx_libjava') svnRepositoryUrlBase copyReplaceAll:$/
d617b4590431 (Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3098
diff changeset
   805
                            with:$_) replaceAll:$: with:$_)
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   806
    ].
3196
d617b4590431 (Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3098
diff changeset
   807
    ^ CacheDirectory
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   808
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   809
    "Created: / 08-04-2011 / 15:02:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3196
d617b4590431 (Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3098
diff changeset
   810
    "Modified: / 04-08-2014 / 15:53:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
198
5543d1079a4a *** empty log message ***
cg
parents: 192
diff changeset
   811
!
5543d1079a4a *** empty log message ***
cg
parents: 192
diff changeset
   812
192
80dde7b3cd73 checkin from browser
cg
parents: 191
diff changeset
   813
classPath
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   814
    ^ClassPath
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   815
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   816
    "Created: / 07-02-1997 / 19:23:45 / cg"
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   817
    "Modified: / 16-01-2013 / 12:45:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
192
80dde7b3cd73 checkin from browser
cg
parents: 191
diff changeset
   818
!
80dde7b3cd73 checkin from browser
cg
parents: 191
diff changeset
   819
80dde7b3cd73 checkin from browser
cg
parents: 191
diff changeset
   820
classPath:aCollectionOfPaths
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   821
    ClassPath := aCollectionOfPaths
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   822
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   823
    "Created: / 07-02-1997 / 19:23:45 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   824
    "Modified: / 17-09-1998 / 20:44:09 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   825
    "Modified: / 16-01-2013 / 12:44:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   826
!
192
80dde7b3cd73 checkin from browser
cg
parents: 191
diff changeset
   827
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   828
classPathAsString
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   829
    ^ (self classPath collect: [ :each | each pathName ]) asStringWith: $:.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   830
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   831
    "Created: / 12-12-2012 / 23:55:00 / Marcel Hlopko <marcel.hlopko@fit.cvut.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   832
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   833
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   834
classPathBundle
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   835
    ^ClassPathBundle
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   836
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   837
    "Created: / 25-01-2013 / 21:49:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
192
80dde7b3cd73 checkin from browser
cg
parents: 191
diff changeset
   838
!
80dde7b3cd73 checkin from browser
cg
parents: 191
diff changeset
   839
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   840
effectiveClassPath
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   841
    ^ClassPathBundle classPath , self classPath
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   842
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   843
    "
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   844
    Java effectiveClassPath
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   845
    "
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   846
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   847
    "Created: / 22-11-2010 / 13:03:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   848
    "Modified: / 17-01-2011 / 09:44:16 / kursjan <kursjan@fit.cvut.cz>"
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   849
    "Modified: / 23-01-2013 / 14:45:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   850
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   851
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   852
effectiveExtensionsPath
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   853
    "Return an effective list of directories that contains
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   854
     extensions to Java classes. These extensions are loaded
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   855
     by JavaClassReader each time the class is loaded into
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   856
     running system"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   857
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   858
    ^self effectiveExtensionsPathForRelease: Release
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   859
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   860
    "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   861
    Java effectiveExtensionsPath
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   862
    "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   863
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   864
    "Created: / 06-09-2012 / 11:27:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   865
!
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   866
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   867
effectiveSourceDirectories
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   868
    ^Release sourcePath , ClassPathBundle sourcePath , SourcePath
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   869
    "
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   870
        Java effectiveSourceDirectories
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   871
    "
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   872
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   873
    "Created: / 30-11-2010 / 11:53:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   874
    "Modified: / 23-01-2013 / 15:22:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   875
!
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   876
276
70c74d8bd43f added path exclusion
cg
parents: 274
diff changeset
   877
excludedClassPath
70c74d8bd43f added path exclusion
cg
parents: 274
diff changeset
   878
    ^ ExcludedClassPath
70c74d8bd43f added path exclusion
cg
parents: 274
diff changeset
   879
70c74d8bd43f added path exclusion
cg
parents: 274
diff changeset
   880
    "Modified: / 7.2.1997 / 19:23:55 / cg"
70c74d8bd43f added path exclusion
cg
parents: 274
diff changeset
   881
    "Created: / 27.1.1998 / 21:57:13 / cg"
70c74d8bd43f added path exclusion
cg
parents: 274
diff changeset
   882
!
70c74d8bd43f added path exclusion
cg
parents: 274
diff changeset
   883
70c74d8bd43f added path exclusion
cg
parents: 274
diff changeset
   884
isExcludedFromClassPath:fileName
70c74d8bd43f added path exclusion
cg
parents: 274
diff changeset
   885
    |nm|
70c74d8bd43f added path exclusion
cg
parents: 274
diff changeset
   886
70c74d8bd43f added path exclusion
cg
parents: 274
diff changeset
   887
    nm := fileName asFilename pathName.
70c74d8bd43f added path exclusion
cg
parents: 274
diff changeset
   888
    ExcludedClassPath do:[:excludedPath |
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   889
	(nm startsWith:excludedPath) ifTrue:[^ true].
276
70c74d8bd43f added path exclusion
cg
parents: 274
diff changeset
   890
    ].
70c74d8bd43f added path exclusion
cg
parents: 274
diff changeset
   891
    ^ false
70c74d8bd43f added path exclusion
cg
parents: 274
diff changeset
   892
70c74d8bd43f added path exclusion
cg
parents: 274
diff changeset
   893
    "Created: / 27.1.1998 / 22:00:40 / cg"
70c74d8bd43f added path exclusion
cg
parents: 274
diff changeset
   894
!
70c74d8bd43f added path exclusion
cg
parents: 274
diff changeset
   895
201
912c48b6e7ac *** empty log message ***
cg
parents: 200
diff changeset
   896
javaHome
3196
d617b4590431 (Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3098
diff changeset
   897
    JavaHome isNil ifTrue:[
d617b4590431 (Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3098
diff changeset
   898
        ^ Release javaHome
d617b4590431 (Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3098
diff changeset
   899
    ].
d617b4590431 (Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3098
diff changeset
   900
    ^ JavaHome
201
912c48b6e7ac *** empty log message ***
cg
parents: 200
diff changeset
   901
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   902
    "Created: / 06-08-1997 / 00:53:19 / cg"
3196
d617b4590431 (Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3098
diff changeset
   903
    "Modified: / 04-08-2014 / 16:01:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
201
912c48b6e7ac *** empty log message ***
cg
parents: 200
diff changeset
   904
!
912c48b6e7ac *** empty log message ***
cg
parents: 200
diff changeset
   905
912c48b6e7ac *** empty log message ***
cg
parents: 200
diff changeset
   906
javaHome:aPath
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   907
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   908
    <resource: #obsolete>
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   909
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   910
    self obsoleteMethodWarning: 'javaHome is now controlled by java release'.
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   911
201
912c48b6e7ac *** empty log message ***
cg
parents: 200
diff changeset
   912
    JavaHome := aPath
912c48b6e7ac *** empty log message ***
cg
parents: 200
diff changeset
   913
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   914
    "Created: / 06-08-1997 / 00:53:23 / cg"
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
   915
    "Modified: / 22-11-2010 / 12:40:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
201
912c48b6e7ac *** empty log message ***
cg
parents: 200
diff changeset
   916
!
912c48b6e7ac *** empty log message ***
cg
parents: 200
diff changeset
   917
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   918
sourcePath
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   919
    ^SourcePath
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   920
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   921
    "Created: / 16-01-1998 / 13:26:55 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   922
    "Modified: / 16-01-2013 / 12:45:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   923
! !
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   924
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   925
!Java class methodsFor:'paths-adding & removing'!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   926
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   927
addToClassPath:pathOrCollection
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   928
    ^ self addToPath:ClassPath path:pathOrCollection
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   929
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   930
    "Created: / 01-08-1997 / 21:10:07 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   931
    "Modified: / 17-09-1998 / 20:43:55 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   932
    "Modified: / 14-12-2011 / 00:04:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   933
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   934
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   935
addToPath:cp filesMatching:pattern in:path
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   936
    |dir|
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   937
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   938
    dir := path asFilename.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   939
    dir exists ifFalse:[ ^ self ].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   940
    dir directoryContents do:[:fname |
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   941
	(fname matches:pattern) ifTrue:[
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   942
	    |p|
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   943
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   944
	    p := (dir / fname) pathName.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   945
	    (cp includes:p) ifFalse:[
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   946
		cp add:p.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   947
		cp == ClassPath ifTrue:[
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   948
		    self addToClassPathInRuntime:p.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   949
		].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   950
		FailedToLoadClasses := nil
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   951
	    ]
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   952
	]
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   953
    ].
668
babdc674688d java setup
cg
parents: 666
diff changeset
   954
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   955
    "Created: / 14-12-2011 / 00:04:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   956
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   957
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   958
addToPath:cp path:pathOrCollection
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   959
    |path|
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   960
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   961
    (pathOrCollection isSequenceable and:[pathOrCollection isCharacters not]) ifTrue:[
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   962
	pathOrCollection do:[:each |
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   963
	    self addToPath:cp path:each
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   964
	].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   965
	^ self.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   966
    ].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   967
    path := pathOrCollection asFilename.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   968
    (pathOrCollection asString includes:$*) ifTrue:[
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   969
	self
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   970
	    addToPath:cp
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   971
	    filesMatching:path baseName
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   972
	    in:path directoryName.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   973
    ] ifFalse:[
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   974
	(ClassPath includes:pathOrCollection asString) ifFalse:[
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   975
	    cp add:pathOrCollection asString.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   976
	    cp == ClassPath ifTrue:[
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   977
		self addToClassPathInRuntime:pathOrCollection.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   978
	    ].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   979
	    FailedToLoadClasses := nil
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   980
	]
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   981
    ]
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   982
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   983
    "Created: / 01-08-1997 / 21:10:07 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   984
    "Modified: / 17-09-1998 / 20:43:55 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   985
    "Created: / 14-12-2011 / 00:03:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   986
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   987
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   988
addToSourcePath:pathOrCollection
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   989
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   990
    self addToPath: SourcePath path: pathOrCollection
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   991
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   992
    "Created: / 02-08-1997 / 14:12:31 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   993
    "Modified: / 14-12-2011 / 00:08:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
668
babdc674688d java setup
cg
parents: 666
diff changeset
   994
!
babdc674688d java setup
cg
parents: 666
diff changeset
   995
192
80dde7b3cd73 checkin from browser
cg
parents: 191
diff changeset
   996
removeFromClassPath:aPath
80dde7b3cd73 checkin from browser
cg
parents: 191
diff changeset
   997
    (ClassPath includes:aPath) ifTrue:[
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
   998
	ClassPath remove:aPath
192
80dde7b3cd73 checkin from browser
cg
parents: 191
diff changeset
   999
    ]
80dde7b3cd73 checkin from browser
cg
parents: 191
diff changeset
  1000
80dde7b3cd73 checkin from browser
cg
parents: 191
diff changeset
  1001
    "Modified: 7.2.1997 / 19:23:55 / cg"
80dde7b3cd73 checkin from browser
cg
parents: 191
diff changeset
  1002
    "Created: 1.8.1997 / 21:10:21 / cg"
188
5de467ea7e45 support color printing
cg
parents: 176
diff changeset
  1003
!
5de467ea7e45 support color printing
cg
parents: 176
diff changeset
  1004
198
5543d1079a4a *** empty log message ***
cg
parents: 192
diff changeset
  1005
removeFromSourcePath:aPath
5543d1079a4a *** empty log message ***
cg
parents: 192
diff changeset
  1006
    (SourceDirectories includes:aPath) ifTrue:[
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1007
	SourceDirectories remove:aPath
198
5543d1079a4a *** empty log message ***
cg
parents: 192
diff changeset
  1008
    ]
5543d1079a4a *** empty log message ***
cg
parents: 192
diff changeset
  1009
5543d1079a4a *** empty log message ***
cg
parents: 192
diff changeset
  1010
    "Modified: 7.2.1997 / 19:23:55 / cg"
5543d1079a4a *** empty log message ***
cg
parents: 192
diff changeset
  1011
    "Created: 2.8.1997 / 14:13:01 / cg"
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1012
! !
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1013
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1014
!Java class methodsFor:'paths-utils'!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1015
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1016
addToClassPathInRuntime: aPath
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1017
    | path  file  url  scl |
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1018
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1019
    "Java might not be loaded/or initialized, in this case
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1020
     there is no no need to inform java about new entry in classpath"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1021
    JavaVM booted ifFalse: [ ^ self ].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1022
    scl := JavaVM systemClassLoader.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1023
    scl isNil ifTrue:[ ^self ].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1024
    path := Java as_String: aPath asString.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1025
    file := ((JavaVM at: 'java.io.File') new)
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1026
		perform: #'<init>(Ljava/lang/String;)V' with: path;
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1027
		yourself.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1028
    url := file perform: #'toURL()Ljava/net/URL;'.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1029
    scl perform: #'addURL(Ljava/net/URL;)V' with: url.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1030
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1031
    "Created: / 01-08-1997 / 21:10:07 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1032
    "Modified: / 17-09-1998 / 20:43:55 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1033
    "Created: / 07-08-2011 / 14:01:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
198
5543d1079a4a *** empty log message ***
cg
parents: 192
diff changeset
  1034
!
5543d1079a4a *** empty log message ***
cg
parents: 192
diff changeset
  1035
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1036
classPathInRuntime: classPath
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1037
    "Sets the classpath in already booted/running Java environment"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1038
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1039
    | urls ucp scl |
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1040
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1041
    JavaVM booted ifFalse: [ ^ self ].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1042
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1043
    scl := JavaVM systemClassLoader.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1044
    scl isNil ifTrue:[ ^self ].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1045
2678
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1046
    urls := (JavaVM classForName:'java.net.URL' definedBy:nil) javaArrayClass new: classPath size.
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1047
    classPath withIndexDo:[:element :index|
2678
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1048
        | path file url |
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1049
        path := Java as_String: element pathName.
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1050
        file := ((JavaVM at: 'java.io.File') new)
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1051
                perform: #'<init>(Ljava/lang/String;)V' with: path;
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1052
                yourself.
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1053
        url := file perform: #'toURL()Ljava/net/URL;'.
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1054
        urls at: index put: url
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1055
    ].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1056
    ucp := (Java classForName:'sun.misc.URLClassPath') new.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1057
    ucp perform: #'<init>([Ljava/net/URL;)V' with: urls.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1058
    scl instVarNamed: #ucp put: ucp.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1059
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1060
    "Created: / 02-08-2012 / 16:04:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2678
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1061
    "Modified: / 07-05-2013 / 11:20:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1062
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1063
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1064
effectiveExtensionsPathForRelease: aRelease
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1065
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1066
    ^ (ExtensionsPath ? #()) ,
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1067
	self extensionsPathFromPackages
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1068
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1069
    "Created: / 06-09-2012 / 11:27:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1070
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1071
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1072
extensionsPathFromPackages
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1073
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1074
    ExtensionsPathPackages isNil ifTrue:[
3561
dd3b2c322d9b #REFACTORING by mawalch
mawalch
parents: 3443
diff changeset
  1075
        ExtensionsPathPackages := OrderedCollection new.
dd3b2c322d9b #REFACTORING by mawalch
mawalch
parents: 3443
diff changeset
  1076
        Smalltalk allPackageIDs do:[:pkg|
dd3b2c322d9b #REFACTORING by mawalch
mawalch
parents: 3443
diff changeset
  1077
            | dir |
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1078
3561
dd3b2c322d9b #REFACTORING by mawalch
mawalch
parents: 3443
diff changeset
  1079
            dir := Smalltalk packageDirectoryForPackageId: pkg.
dd3b2c322d9b #REFACTORING by mawalch
mawalch
parents: 3443
diff changeset
  1080
            dir notNil ifTrue:[
dd3b2c322d9b #REFACTORING by mawalch
mawalch
parents: 3443
diff changeset
  1081
                dir := dir asFilename / 'java' / 'extensions'.
dd3b2c322d9b #REFACTORING by mawalch
mawalch
parents: 3443
diff changeset
  1082
                dir exists ifTrue:[
dd3b2c322d9b #REFACTORING by mawalch
mawalch
parents: 3443
diff changeset
  1083
                    ExtensionsPathPackages add: dir
dd3b2c322d9b #REFACTORING by mawalch
mawalch
parents: 3443
diff changeset
  1084
                ].
dd3b2c322d9b #REFACTORING by mawalch
mawalch
parents: 3443
diff changeset
  1085
            ]
dd3b2c322d9b #REFACTORING by mawalch
mawalch
parents: 3443
diff changeset
  1086
        ].
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1087
    ].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1088
    ^ExtensionsPathPackages.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1089
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1090
    "
3562
46c0abe56fd2 #DOCUMENTATION by mawalch
mawalch
parents: 3561
diff changeset
  1091
     Java extensionsPathFromPackages 
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1092
    "
3561
dd3b2c322d9b #REFACTORING by mawalch
mawalch
parents: 3443
diff changeset
  1093
       
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1094
    "Created: / 06-09-2012 / 11:30:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76
9ff95e14dbfb *** empty log message ***
cg
parents: 71
diff changeset
  1095
!
9ff95e14dbfb *** empty log message ***
cg
parents: 71
diff changeset
  1096
9ff95e14dbfb *** empty log message ***
cg
parents: 71
diff changeset
  1097
sourceDirectories:aCollectionOfPaths
9ff95e14dbfb *** empty log message ***
cg
parents: 71
diff changeset
  1098
    SourceDirectories := aCollectionOfPaths asOrderedCollection
9ff95e14dbfb *** empty log message ***
cg
parents: 71
diff changeset
  1099
9ff95e14dbfb *** empty log message ***
cg
parents: 71
diff changeset
  1100
    "
9ff95e14dbfb *** empty log message ***
cg
parents: 71
diff changeset
  1101
     Java
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1102
	sourceDirectories:#(
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1103
			    '/phys/ibm3/java/src'
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1104
			   )
76
9ff95e14dbfb *** empty log message ***
cg
parents: 71
diff changeset
  1105
    "
9ff95e14dbfb *** empty log message ***
cg
parents: 71
diff changeset
  1106
9ff95e14dbfb *** empty log message ***
cg
parents: 71
diff changeset
  1107
205
11cd2ad78854 *** empty log message ***
cg
parents: 203
diff changeset
  1108
! !
11cd2ad78854 *** empty log message ***
cg
parents: 203
diff changeset
  1109
168
90e39cb3fa04 *** empty log message ***
cg
parents: 167
diff changeset
  1110
!Java class methodsFor:'queries'!
90e39cb3fa04 *** empty log message ***
cg
parents: 167
diff changeset
  1111
90e39cb3fa04 *** empty log message ***
cg
parents: 167
diff changeset
  1112
smalltalkClassFor:typeRef
90e39cb3fa04 *** empty log message ***
cg
parents: 167
diff changeset
  1113
self halt.
90e39cb3fa04 *** empty log message ***
cg
parents: 167
diff changeset
  1114
"/    (typeString startsWith:'[[') ifTrue:[
90e39cb3fa04 *** empty log message ***
cg
parents: 167
diff changeset
  1115
"/        ^ Array
90e39cb3fa04 *** empty log message ***
cg
parents: 167
diff changeset
  1116
"/    ].
90e39cb3fa04 *** empty log message ***
cg
parents: 167
diff changeset
  1117
"/    (typeString startsWith:'[F') ifTrue:[
90e39cb3fa04 *** empty log message ***
cg
parents: 167
diff changeset
  1118
"/        ^ FloatArray
90e39cb3fa04 *** empty log message ***
cg
parents: 167
diff changeset
  1119
"/    ].
90e39cb3fa04 *** empty log message ***
cg
parents: 167
diff changeset
  1120
    self halt.
90e39cb3fa04 *** empty log message ***
cg
parents: 167
diff changeset
  1121
90e39cb3fa04 *** empty log message ***
cg
parents: 167
diff changeset
  1122
    "Modified: 7.4.1997 / 13:33:46 / cg"
90e39cb3fa04 *** empty log message ***
cg
parents: 167
diff changeset
  1123
!
90e39cb3fa04 *** empty log message ***
cg
parents: 167
diff changeset
  1124
90e39cb3fa04 *** empty log message ***
cg
parents: 167
diff changeset
  1125
smalltalkDerefType:typeString
90e39cb3fa04 *** empty log message ***
cg
parents: 167
diff changeset
  1126
    (typeString startsWith:'[') ifTrue:[
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1127
	^ typeString copyFrom:2
168
90e39cb3fa04 *** empty log message ***
cg
parents: 167
diff changeset
  1128
    ].
90e39cb3fa04 *** empty log message ***
cg
parents: 167
diff changeset
  1129
    self halt.
90e39cb3fa04 *** empty log message ***
cg
parents: 167
diff changeset
  1130
90e39cb3fa04 *** empty log message ***
cg
parents: 167
diff changeset
  1131
    "Modified: 7.4.1997 / 13:13:24 / cg"
90e39cb3fa04 *** empty log message ***
cg
parents: 167
diff changeset
  1132
! !
90e39cb3fa04 *** empty log message ***
cg
parents: 167
diff changeset
  1133
135
098936234135 *** empty log message ***
cg
parents: 121
diff changeset
  1134
!Java class methodsFor:'registering java classes'!
17
ea80d8a83063 intitial checkin
cg
parents:
diff changeset
  1135
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1136
at: aJavaName
17
ea80d8a83063 intitial checkin
cg
parents:
diff changeset
  1137
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1138
    ^JavaVM at: aJavaName.
43
2c4ca2eb8d07 checkin from browser
cg
parents: 32
diff changeset
  1139
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1140
    "Modified: / 18-07-1998 / 22:55:16 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1141
    "Modified (format): / 21-10-2011 / 10:40:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
17
ea80d8a83063 intitial checkin
cg
parents:
diff changeset
  1142
!
ea80d8a83063 intitial checkin
cg
parents:
diff changeset
  1143
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1144
at: aJavaName put: aJavaClass
90
918e2740098c resolve rewritten
cg
parents: 84
diff changeset
  1145
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1146
    ^JavaVM at:aJavaName put:aJavaClass.
90
918e2740098c resolve rewritten
cg
parents: 84
diff changeset
  1147
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1148
    "Created: / 17-04-1996 / 23:29:31 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1149
    "Modified: / 07-08-1997 / 19:15:58 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1150
    "Modified (format): / 21-10-2011 / 10:39:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
21
b9dd73f299dd checkin from browser
cg
parents: 17
diff changeset
  1151
!
b9dd73f299dd checkin from browser
cg
parents: 17
diff changeset
  1152
168
90e39cb3fa04 *** empty log message ***
cg
parents: 167
diff changeset
  1153
flushAllJavaResources
2678
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1154
168
90e39cb3fa04 *** empty log message ***
cg
parents: 167
diff changeset
  1155
    self flushClasses.
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1156
    JavaVM reflection notNil ifTrue:[
2678
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1157
        JavaVM reflection flush.
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1158
    ].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1159
    InternedStrings := Dictionary new.
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
  1160
    SourceCache := CacheDictionary new: 32.
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
  1161
    SourceArchiveCache := CacheDictionary new: 32.
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1162
    ClassPathPackages := nil.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1163
    JavaMonitor initialize.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1164
    Smalltalk garbageCollect.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1165
    ObjectMemory
2678
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1166
        allObjectsDo: [:someObject |
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1167
            someObject isBehavior ifTrue: [
2841
6fa1bcf9c997 JavaClass>>#name vs. #binaryName refactoring
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2807
diff changeset
  1168
                (someObject isJavaClass and:[someObject class ~~ JavaClassAccessor]) ifTrue: [
6fa1bcf9c997 JavaClass>>#name vs. #binaryName refactoring
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2807
diff changeset
  1169
2678
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1170
                    | cp |
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
  1171
2678
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1172
                    cp := someObject constantPool.
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1173
                    Class flushSubclassInfoFor: someObject.
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1174
                    1 to: cp size do:[:i|cp at: i put: nil].
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1175
                    someObject setConstantPool: nil.
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1176
                    someObject setInterfaces: nil.
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1177
                    someObject setMethodDictionary: (MethodDictionary new).
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1178
                    Logger
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1179
                        log: 'flushing ' , someObject fullName
3384
98eb8443f4f4 Use new Logger API (use Logger severityXXX instead of symbols)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3334
diff changeset
  1180
                        severity: Logger severityDEBUG
2678
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1181
                        facility: 'JVM'.
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1182
                ]
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1183
            ].
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1184
        ].
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1185
    JavaVM releasehSystemClassLoader.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1186
    JavaVM releasehSmalltalkClassLoader.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1187
    Class flushSubclassInfoFor: JavaObject.
2678
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1188
    GroovyEvaluator flushWorkspaceShell.
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1189
    GroovyEvaluator flushWorkspaceBinding.
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1190
    GroovyCompiler  flushGroovyClassLoader.
2678
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1191
2105
68d6afd0c8e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
  1192
    JavaClass flushClassesInitOrder.
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1193
    JavaVM finalizationLobby notNil ifTrue:[
2678
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1194
        JavaVM finalizationLobby stopFinalizationProcess
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1195
    ].
3275
881799d310e3 Intern all constant pool strings.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3241
diff changeset
  1196
    JavaClassReader flushInternedStrings.
3308
b0f4e406b42d Fix in flushing Java - flush smalltalk-to-java thread object mapping...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3296
diff changeset
  1197
    Threads := IdentityDictionary new.
3309
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1198
    self flushProxies.
3233
7bf7a8831ed9 Fixed assertions Java>>removeThread:for:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3214
diff changeset
  1199
    Smalltalk garbageCollect.
168
90e39cb3fa04 *** empty log message ***
cg
parents: 167
diff changeset
  1200
90e39cb3fa04 *** empty log message ***
cg
parents: 167
diff changeset
  1201
    "
2678
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1202
    Java flushAllJavaResources
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1203
    "
168
90e39cb3fa04 *** empty log message ***
cg
parents: 167
diff changeset
  1204
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
  1205
    "Modified: / 06-11-2001 / 09:49:37 / cg"
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1206
    "Modified: / 02-11-2011 / 21:34:13 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
3384
98eb8443f4f4 Use new Logger API (use Logger severityXXX instead of symbols)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3334
diff changeset
  1207
    "Modified: / 02-03-2015 / 14:11:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
168
90e39cb3fa04 *** empty log message ***
cg
parents: 167
diff changeset
  1208
!
90e39cb3fa04 *** empty log message ***
cg
parents: 167
diff changeset
  1209
21
b9dd73f299dd checkin from browser
cg
parents: 17
diff changeset
  1210
flushClasses
2952
ff6465e92d95 Flush JavaClassRegistry's notifier when flushing classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2923
diff changeset
  1211
3233
7bf7a8831ed9 Fixed assertions Java>>removeThread:for:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3214
diff changeset
  1212
    | packagesInSystemDictionary |
2952
ff6465e92d95 Flush JavaClassRegistry's notifier when flushing classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2923
diff changeset
  1213
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1214
    UnresolvedClassRefs := nil.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1215
    JavaVM flushClasses.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1216
    Smalltalk keysAndValuesDo:[:name :class |
2952
ff6465e92d95 Flush JavaClassRegistry's notifier when flushing classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2923
diff changeset
  1217
        class isJavaClass ifTrue:[
2967
8ffaaa45f964 Fix in Java>>flushClasses: do not use Smalltalk>>removeKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2952
diff changeset
  1218
            Smalltalk at: name put: nil.
2952
ff6465e92d95 Flush JavaClassRegistry's notifier when flushing classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2923
diff changeset
  1219
        ]
168
90e39cb3fa04 *** empty log message ***
cg
parents: 167
diff changeset
  1220
    ].
2952
ff6465e92d95 Flush JavaClassRegistry's notifier when flushing classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2923
diff changeset
  1221
    packagesInSystemDictionary := Set new.
ff6465e92d95 Flush JavaClassRegistry's notifier when flushing classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2923
diff changeset
  1222
    Smalltalk keysAndValuesDo:[:key :value|
ff6465e92d95 Flush JavaClassRegistry's notifier when flushing classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2923
diff changeset
  1223
        "/ Do not remove JAVA namespace - used by Java bridge, sigh
ff6465e92d95 Flush JavaClassRegistry's notifier when flushing classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2923
diff changeset
  1224
        (key ~~ #JAVA and:[value isClass and:[value superclass == JavaPackage]]) ifTrue:[
ff6465e92d95 Flush JavaClassRegistry's notifier when flushing classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2923
diff changeset
  1225
            packagesInSystemDictionary add: key.
ff6465e92d95 Flush JavaClassRegistry's notifier when flushing classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2923
diff changeset
  1226
        ].
ff6465e92d95 Flush JavaClassRegistry's notifier when flushing classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2923
diff changeset
  1227
    ].
ff6465e92d95 Flush JavaClassRegistry's notifier when flushing classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2923
diff changeset
  1228
    packagesInSystemDictionary do:[:key|
ff6465e92d95 Flush JavaClassRegistry's notifier when flushing classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2923
diff changeset
  1229
        Smalltalk removeKey: key.
3233
7bf7a8831ed9 Fixed assertions Java>>removeThread:for:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3214
diff changeset
  1230
    ].
2105
68d6afd0c8e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
  1231
167
77dcbc4b2201 *** empty log message ***
cg
parents: 162
diff changeset
  1232
    Java_lang_String := Java_lang_Class := nil.
261
d95d5a3cc475 lots of new stuff
cg
parents: 255
diff changeset
  1233
    JavaVM releaseAllJavaResources.
90
918e2740098c resolve rewritten
cg
parents: 84
diff changeset
  1234
    JavaUnresolvedConstant flushPatchLists.
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
  1235
    Debugger == DebugView ifTrue:[Debugger newDebugger].
423
08af061c56a8 javaClass now uses its fullName in name
cg
parents: 421
diff changeset
  1236
    ObjectMemory flushCaches.
21
b9dd73f299dd checkin from browser
cg
parents: 17
diff changeset
  1237
b9dd73f299dd checkin from browser
cg
parents: 17
diff changeset
  1238
    "
b9dd73f299dd checkin from browser
cg
parents: 17
diff changeset
  1239
     Java flushClasses
b9dd73f299dd checkin from browser
cg
parents: 17
diff changeset
  1240
    "
b9dd73f299dd checkin from browser
cg
parents: 17
diff changeset
  1241
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1242
    "Modified: / 06-11-2001 / 09:47:49 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1243
    "Modified: / 16-11-2011 / 09:43:13 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2952
ff6465e92d95 Flush JavaClassRegistry's notifier when flushing classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2923
diff changeset
  1244
    "Modified: / 30-11-2013 / 06:58:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
21
b9dd73f299dd checkin from browser
cg
parents: 17
diff changeset
  1245
!
b9dd73f299dd checkin from browser
cg
parents: 17
diff changeset
  1246
3309
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1247
flushProxies
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1248
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1249
    Smalltalk allClassesDo:[:cls |
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1250
        | selectorsToRemove meta |
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1251
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1252
        selectorsToRemove := Set new.
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1253
        cls methodDictionary keysAndValuesDo:[:selector :method |
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1254
            method isProxyMethod ifTrue:[ 
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1255
                selectorsToRemove add: selector.
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1256
            ].
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1257
        ].
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1258
        selectorsToRemove do:[:selector | 
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1259
            cls basicRemoveSelector: selector.  
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1260
        ].
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1261
        meta := cls class.
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1262
        selectorsToRemove := Set new.
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1263
        meta methodDictionary keysAndValuesDo:[:selector :method |
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1264
            method isProxyMethod ifTrue:[ 
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1265
                selectorsToRemove add: selector.
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1266
            ].
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1267
        ].
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1268
        selectorsToRemove do:[:selector | 
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1269
            meta basicRemoveSelector: selector.  
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1270
        ].
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1271
    ].
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1272
    ObjectMemory flushCaches.
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1273
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1274
    "
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1275
    Java flushProxies
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1276
    "
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1277
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1278
    "Created: / 17-12-2014 / 13:29:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1279
!
a467328c29fd Fix in flushing Java - flush all dynamic proxies
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3308
diff changeset
  1280
43
2c4ca2eb8d07 checkin from browser
cg
parents: 32
diff changeset
  1281
markAllClassesUninitialized
2c4ca2eb8d07 checkin from browser
cg
parents: 32
diff changeset
  1282
    self allClassesDo:[:aJavaClass |
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1283
	aJavaClass markUninitialized
43
2c4ca2eb8d07 checkin from browser
cg
parents: 32
diff changeset
  1284
    ].
2c4ca2eb8d07 checkin from browser
cg
parents: 32
diff changeset
  1285
2c4ca2eb8d07 checkin from browser
cg
parents: 32
diff changeset
  1286
    "
2c4ca2eb8d07 checkin from browser
cg
parents: 32
diff changeset
  1287
     Java markAllClassesUninitialized
2c4ca2eb8d07 checkin from browser
cg
parents: 32
diff changeset
  1288
    "
2c4ca2eb8d07 checkin from browser
cg
parents: 32
diff changeset
  1289
!
2c4ca2eb8d07 checkin from browser
cg
parents: 32
diff changeset
  1290
21
b9dd73f299dd checkin from browser
cg
parents: 17
diff changeset
  1291
rememberUnresolved:anUnresolvedClassRef
3385
58d72cc6d5f6 Replaced old-style `'string' infoPrintCR` logging with new-style `Logger log:'string'` logging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3384
diff changeset
  1292
    Logger log: ('JAVA: remember unresolved class: ' , anUnresolvedClassRef fullName) severity: Logger severityDEBUG facility: #JVM.
90
918e2740098c resolve rewritten
cg
parents: 84
diff changeset
  1293
918e2740098c resolve rewritten
cg
parents: 84
diff changeset
  1294
    UnresolvedClassRefs isNil ifTrue:[
3385
58d72cc6d5f6 Replaced old-style `'string' infoPrintCR` logging with new-style `Logger log:'string'` logging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3384
diff changeset
  1295
        UnresolvedClassRefs := Dictionary new.
90
918e2740098c resolve rewritten
cg
parents: 84
diff changeset
  1296
    ].
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1297
    UnresolvedClassRefs
3385
58d72cc6d5f6 Replaced old-style `'string' infoPrintCR` logging with new-style `Logger log:'string'` logging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3384
diff changeset
  1298
        at:anUnresolvedClassRef fullName
58d72cc6d5f6 Replaced old-style `'string' infoPrintCR` logging with new-style `Logger log:'string'` logging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3384
diff changeset
  1299
        put:anUnresolvedClassRef
21
b9dd73f299dd checkin from browser
cg
parents: 17
diff changeset
  1300
3385
58d72cc6d5f6 Replaced old-style `'string' infoPrintCR` logging with new-style `Logger log:'string'` logging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3384
diff changeset
  1301
    "Created: / 18-04-1996 / 00:05:31 / cg"
58d72cc6d5f6 Replaced old-style `'string' infoPrintCR` logging with new-style `Logger log:'string'` logging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3384
diff changeset
  1302
    "Modified: / 19-10-1998 / 20:57:44 / cg"
58d72cc6d5f6 Replaced old-style `'string' infoPrintCR` logging with new-style `Logger log:'string'` logging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3384
diff changeset
  1303
    "Modified: / 02-03-2015 / 15:58:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
90
918e2740098c resolve rewritten
cg
parents: 84
diff changeset
  1304
!
918e2740098c resolve rewritten
cg
parents: 84
diff changeset
  1305
162
15b1e9c8e2f5 preps for class-remove
cg
parents: 147
diff changeset
  1306
removeClass:aJavaClass
2737
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1307
    "Remove the class from the system, as well as all its subclasses
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1308
     (or users of the interface, if class is interface)"
162
15b1e9c8e2f5 preps for class-remove
cg
parents: 147
diff changeset
  1309
2737
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1310
    JavaVM unloadClass: aJavaClass.
393
1efe41b5bc98 #removeClass: fix
cg
parents: 381
diff changeset
  1311
2737
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1312
    "Modified: / 19-10-1998 / 20:58:49 / cg"
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1313
    "Modified (comment): / 14-09-2013 / 23:51:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
162
15b1e9c8e2f5 preps for class-remove
cg
parents: 147
diff changeset
  1314
!
15b1e9c8e2f5 preps for class-remove
cg
parents: 147
diff changeset
  1315
90
918e2740098c resolve rewritten
cg
parents: 84
diff changeset
  1316
unresolvedClassRefFor:aClassName
918e2740098c resolve rewritten
cg
parents: 84
diff changeset
  1317
    UnresolvedClassRefs isNil ifTrue:[^ nil].
918e2740098c resolve rewritten
cg
parents: 84
diff changeset
  1318
    ^ UnresolvedClassRefs at:aClassName ifAbsent:nil.
393
1efe41b5bc98 #removeClass: fix
cg
parents: 381
diff changeset
  1319
1efe41b5bc98 #removeClass: fix
cg
parents: 381
diff changeset
  1320
    "Modified: / 19.10.1998 / 20:56:46 / cg"
167
77dcbc4b2201 *** empty log message ***
cg
parents: 162
diff changeset
  1321
!
77dcbc4b2201 *** empty log message ***
cg
parents: 162
diff changeset
  1322
77dcbc4b2201 *** empty log message ***
cg
parents: 162
diff changeset
  1323
updateClassRefsFrom:oldClass to:newClass
77dcbc4b2201 *** empty log message ***
cg
parents: 162
diff changeset
  1324
    "update all references to oldClass to now refer to newClass.
77dcbc4b2201 *** empty log message ***
cg
parents: 162
diff changeset
  1325
     sent, when a class is reloaded"
77dcbc4b2201 *** empty log message ***
cg
parents: 162
diff changeset
  1326
214
76588d86cbfb checkin from browser
cg
parents: 212
diff changeset
  1327
    newClass notNil ifTrue:[
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1328
	"/
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1329
	"/ kludge: the new class might have been resolved with the oldClass ...
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1330
	"/
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1331
	newClass constantPool
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1332
	    updateClassRefsFrom:oldClass to:newClass.
214
76588d86cbfb checkin from browser
cg
parents: 212
diff changeset
  1333
    ].
205
11cd2ad78854 *** empty log message ***
cg
parents: 203
diff changeset
  1334
203
67af98594672 *** empty log message ***
cg
parents: 201
diff changeset
  1335
    self allClassesDo:[:aJavaClass |
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1336
	aJavaClass updateClassRefsFrom:oldClass to:newClass
203
67af98594672 *** empty log message ***
cg
parents: 201
diff changeset
  1337
    ].
167
77dcbc4b2201 *** empty log message ***
cg
parents: 162
diff changeset
  1338
77dcbc4b2201 *** empty log message ***
cg
parents: 162
diff changeset
  1339
    "Created: 26.3.1997 / 13:49:20 / cg"
214
76588d86cbfb checkin from browser
cg
parents: 212
diff changeset
  1340
    "Modified: 12.8.1997 / 03:04:44 / cg"
17
ea80d8a83063 intitial checkin
cg
parents:
diff changeset
  1341
! !
ea80d8a83063 intitial checkin
cg
parents:
diff changeset
  1342
135
098936234135 *** empty log message ***
cg
parents: 121
diff changeset
  1343
!Java class methodsFor:'source management'!
76
9ff95e14dbfb *** empty log message ***
cg
parents: 71
diff changeset
  1344
3233
7bf7a8831ed9 Fixed assertions Java>>removeThread:for:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3214
diff changeset
  1345
classSourceStreamFor: aClass
2737
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1346
    | jpackage  dirName  sourceFileName  sourceFile  loader  codeBaseURL  protocol  codeBaseURLIdx  src |
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
  1347
2737
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1348
    aClass isNil ifTrue: [
2678
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1349
        ^ nil
76
9ff95e14dbfb *** empty log message ***
cg
parents: 71
diff changeset
  1350
    ].
3233
7bf7a8831ed9 Fixed assertions Java>>removeThread:for:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3214
diff changeset
  1351
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
  1352
    "/ look at the cache"
76
9ff95e14dbfb *** empty log message ***
cg
parents: 71
diff changeset
  1353
2717
16564a7101b8 Initial support for displaying only selected method's source in browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2705
diff changeset
  1354
    "/ maybe it was loaded by a java classLoader ...
3233
7bf7a8831ed9 Fixed assertions Java>>removeThread:for:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3214
diff changeset
  1355
2737
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1356
    (loader := aClass classLoader) notNil ifTrue: [
3646
0b6e53f03c07 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3571
diff changeset
  1357
        codeBaseURLIdx := loader class instVarIndexFor: 'codeBaseURL'.
2737
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1358
        codeBaseURLIdx notNil ifTrue: [
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1359
            (codeBaseURL := loader instVarAt: codeBaseURLIdx) notNil ifTrue: [
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1360
                (protocol := codeBaseURL instVarNamed: 'protocol') notNil ifTrue: [
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1361
                    (Java as_ST_String: protocol) = 'file' ifTrue: [
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1362
                        dirName := Java as_ST_String: (codeBaseURL instVarNamed: 'file').
2717
16564a7101b8 Initial support for displaying only selected method's source in browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2705
diff changeset
  1363
                        dirName := dirName asFilename.
2737
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1364
                        dirName exists ifTrue: [
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1365
                            aClass sourceFile notNil ifTrue: [
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1366
                                sourceFile := sourceFileName := dirName construct: aClass sourceFile.
2678
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1367
                            ]
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1368
                        ]
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1369
                    ]
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1370
                ]
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1371
            ]
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1372
        ].
3233
7bf7a8831ed9 Fixed assertions Java>>removeThread:for:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3214
diff changeset
  1373
3707
bfc8fce84a73 #DOCUMENTATION by mawalch
mawalch
parents: 3662
diff changeset
  1374
        "/ HACK HACK HACK: The expecco JImport plugin load the Java class and
2717
16564a7101b8 Initial support for displaying only selected method's source in browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2705
diff changeset
  1375
        "/ sets fake classloader - an instance of Expecco::JIClassLoaderPlaceholder
16564a7101b8 Initial support for displaying only selected method's source in browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2705
diff changeset
  1376
        "/ which in turn references codelibrary in an instvar. If that's the case,
16564a7101b8 Initial support for displaying only selected method's source in browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2705
diff changeset
  1377
        "/ ask that library for source
3233
7bf7a8831ed9 Fixed assertions Java>>removeThread:for:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3214
diff changeset
  1378
2737
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1379
        loader class name == #'Expecco::JIClassLoaderPlaceholder' ifTrue: [
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1380
            ^ (loader library classSourceOf: aClass name) readStream.
2717
16564a7101b8 Initial support for displaying only selected method's source in browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2705
diff changeset
  1381
        ]
76
9ff95e14dbfb *** empty log message ***
cg
parents: 71
diff changeset
  1382
    ].
3233
7bf7a8831ed9 Fixed assertions Java>>removeThread:for:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3214
diff changeset
  1383
76
9ff95e14dbfb *** empty log message ***
cg
parents: 71
diff changeset
  1384
    "/ if that fails, look in standard places
3233
7bf7a8831ed9 Fixed assertions Java>>removeThread:for:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3214
diff changeset
  1385
2737
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1386
    (sourceFile isNil or: [ sourceFile exists not ]) ifTrue: [
2678
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1387
        sourceFile := aClass sourceFile.
2737
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1388
        sourceFile isNil ifTrue: [
2678
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1389
            "Hmm, hmm...just a guess"
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1390
            sourceFile := (aClass lastName upTo: $$) , '.java'.
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1391
        ].
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1392
        jpackage := aClass javaPackageAsDirname.
3233
7bf7a8831ed9 Fixed assertions Java>>removeThread:for:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3214
diff changeset
  1393
        self effectiveSourceDirectories do: [:dir |
7bf7a8831ed9 Fixed assertions Java>>removeThread:for:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3214
diff changeset
  1394
            src := self
2737
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1395
                         classSourceStreamForFile: sourceFile
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1396
                         package: jpackage
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1397
                         in: dir.
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1398
            src notNil ifTrue: [
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1399
                ^ src
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1400
            ]
2678
c865275e48a7 Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2633
diff changeset
  1401
        ]
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1402
    ].
2737
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1403
    sourceFile isFilename ifFalse: [
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1404
        ^ nil
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1405
    ].
2807
46f6ef83cce6 More extensions for List
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2737
diff changeset
  1406
    ^ sourceFile readStream
76
9ff95e14dbfb *** empty log message ***
cg
parents: 71
diff changeset
  1407
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
  1408
    "
2737
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1409
        Java classSourceOf: JAVA::java::lang::Object"
571
b5ae2faeb568 allow for the sources to be stored in one big zip-archive
cg
parents: 567
diff changeset
  1410
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
  1411
    "Modified: / 27-01-1999 / 20:40:30 / cg"
2807
46f6ef83cce6 More extensions for List
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2737
diff changeset
  1412
    "Modified: / 07-10-2013 / 17:01:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3707
bfc8fce84a73 #DOCUMENTATION by mawalch
mawalch
parents: 3662
diff changeset
  1413
    "Modified (comment): / 18-05-2017 / 17:32:26 / mawalch"
2737
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1414
!
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1415
3233
7bf7a8831ed9 Fixed assertions Java>>removeThread:for:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3214
diff changeset
  1416
classSourceStreamForFile: filename package: jpackage in: dirOrZipFile
3098
ebf6ad1545af source code access fixed for apple:
Claus Gittinger
parents: 3067
diff changeset
  1417
    | fn  pn  zar memberName member zipMemberName|
2737
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1418
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1419
    fn := dirOrZipFile asFilename.
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1420
    pn := dirOrZipFile asString.
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1421
    fn isDirectory ifTrue: [
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1422
        jpackage notNil ifTrue: [
2923
0be6bc618029 When accessing Java source in .har, try uncompress it using ZipArchive first...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2909
diff changeset
  1423
            (memberName := fn / jpackage / filename) exists ifTrue: [
0be6bc618029 When accessing Java source in .har, try uncompress it using ZipArchive first...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2909
diff changeset
  1424
                ^ memberName readStream
2737
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1425
            ].
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1426
        ].
2923
0be6bc618029 When accessing Java source in .har, try uncompress it using ZipArchive first...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2909
diff changeset
  1427
        (memberName := fn / filename) exists ifTrue: [
0be6bc618029 When accessing Java source in .har, try uncompress it using ZipArchive first...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2909
diff changeset
  1428
            ^ memberName readStream
2737
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1429
        ].
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1430
    ] ifFalse: [
3233
7bf7a8831ed9 Fixed assertions Java>>removeThread:for:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3214
diff changeset
  1431
        ((pn last == $p and: [ fn hasSuffix: 'zip' ])
7bf7a8831ed9 Fixed assertions Java>>removeThread:for:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3214
diff changeset
  1432
            or: [ (pn last == $r and: [ fn hasSuffix: 'jar' ]) ])
2737
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1433
                ifTrue: [
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1434
                    zar := SourceArchiveCache at: dirOrZipFile
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1435
                            ifAbsentPut: [ ZipArchive oldFileNamed: fn pathName ].
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1436
                    zar notNil ifTrue: [
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1437
                        jpackage notNil ifTrue: [
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1438
                            OperatingSystem fileSeparator ~~ $/ ifTrue: [
3233
7bf7a8831ed9 Fixed assertions Java>>removeThread:for:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3214
diff changeset
  1439
                                memberName := (jpackage copyReplaceAll: OperatingSystem fileSeparator with: $/)
2737
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1440
                                        , '/' , filename
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1441
                            ] ifFalse: [
2923
0be6bc618029 When accessing Java source in .har, try uncompress it using ZipArchive first...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2909
diff changeset
  1442
                                memberName := jpackage , '/' , filename.
2737
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1443
                            ]
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1444
                        ] ifFalse: [
2923
0be6bc618029 When accessing Java source in .har, try uncompress it using ZipArchive first...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2909
diff changeset
  1445
                            memberName := filename
2737
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1446
                        ].
3098
ebf6ad1545af source code access fixed for apple:
Claus Gittinger
parents: 3067
diff changeset
  1447
                        zipMemberName := memberName.
ebf6ad1545af source code access fixed for apple:
Claus Gittinger
parents: 3067
diff changeset
  1448
                        member := zar findMember: zipMemberName.
ebf6ad1545af source code access fixed for apple:
Claus Gittinger
parents: 3067
diff changeset
  1449
                        member isNil ifTrue: [
ebf6ad1545af source code access fixed for apple:
Claus Gittinger
parents: 3067
diff changeset
  1450
                            "/ apple sources in the src.jar begin with a src/ prefix
ebf6ad1545af source code access fixed for apple:
Claus Gittinger
parents: 3067
diff changeset
  1451
                            zipMemberName := 'src/',memberName.
ebf6ad1545af source code access fixed for apple:
Claus Gittinger
parents: 3067
diff changeset
  1452
                            member := zar findMember: zipMemberName.
ebf6ad1545af source code access fixed for apple:
Claus Gittinger
parents: 3067
diff changeset
  1453
                        ].
2923
0be6bc618029 When accessing Java source in .har, try uncompress it using ZipArchive first...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2909
diff changeset
  1454
                        member notNil ifTrue: [
0be6bc618029 When accessing Java source in .har, try uncompress it using ZipArchive first...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2909
diff changeset
  1455
                            | source |
2737
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1456
2923
0be6bc618029 When accessing Java source in .har, try uncompress it using ZipArchive first...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2909
diff changeset
  1457
                            zar reopenForReading.
3098
ebf6ad1545af source code access fixed for apple:
Claus Gittinger
parents: 3067
diff changeset
  1458
                            source := zar extract: zipMemberName.
2923
0be6bc618029 When accessing Java source in .har, try uncompress it using ZipArchive first...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2909
diff changeset
  1459
                            "/ Check, sometimes the ZipArchive fails to uncompress
0be6bc618029 When accessing Java source in .har, try uncompress it using ZipArchive first...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2909
diff changeset
  1460
                            "/ correctly. Not sure why...
0be6bc618029 When accessing Java source in .har, try uncompress it using ZipArchive first...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2909
diff changeset
  1461
                            (source size == member uncompressedSize) ifTrue:[
0be6bc618029 When accessing Java source in .har, try uncompress it using ZipArchive first...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2909
diff changeset
  1462
                                ^ source asString readStream
0be6bc618029 When accessing Java source in .har, try uncompress it using ZipArchive first...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2909
diff changeset
  1463
                            ] ifFalse:[
0be6bc618029 When accessing Java source in .har, try uncompress it using ZipArchive first...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2909
diff changeset
  1464
                                "Kludge because of broken ZipArchive"
3098
ebf6ad1545af source code access fixed for apple:
Claus Gittinger
parents: 3067
diff changeset
  1465
                                | cache memberFileName |
2923
0be6bc618029 When accessing Java source in .har, try uncompress it using ZipArchive first...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2909
diff changeset
  1466
0be6bc618029 When accessing Java source in .har, try uncompress it using ZipArchive first...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2909
diff changeset
  1467
                                cache := Java cacheDirectory / Release name / 'src'.
0be6bc618029 When accessing Java source in .har, try uncompress it using ZipArchive first...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2909
diff changeset
  1468
                                cache exists ifFalse: [
0be6bc618029 When accessing Java source in .har, try uncompress it using ZipArchive first...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2909
diff changeset
  1469
                                    cache recursiveMakeDirectory
0be6bc618029 When accessing Java source in .har, try uncompress it using ZipArchive first...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2909
diff changeset
  1470
                                ].
0be6bc618029 When accessing Java source in .har, try uncompress it using ZipArchive first...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2909
diff changeset
  1471
                                (cache / memberName) exists ifTrue: [
0be6bc618029 When accessing Java source in .har, try uncompress it using ZipArchive first...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2909
diff changeset
  1472
                                    ^ (cache / memberName) readStream
0be6bc618029 When accessing Java source in .har, try uncompress it using ZipArchive first...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2909
diff changeset
  1473
                                ].
3233
7bf7a8831ed9 Fixed assertions Java>>removeThread:for:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3214
diff changeset
  1474
                                OperatingSystem
2923
0be6bc618029 When accessing Java source in .har, try uncompress it using ZipArchive first...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2909
diff changeset
  1475
                                    executeCommand: ('unzip "%1" "%2"' bindWith: fn asAbsoluteFilename asString
0be6bc618029 When accessing Java source in .har, try uncompress it using ZipArchive first...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2909
diff changeset
  1476
                                    with: memberName asString)
0be6bc618029 When accessing Java source in .har, try uncompress it using ZipArchive first...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2909
diff changeset
  1477
                                    inDirectory: cache asString.
3098
ebf6ad1545af source code access fixed for apple:
Claus Gittinger
parents: 3067
diff changeset
  1478
                                (memberFileName := cache / memberName) exists ifTrue: [
ebf6ad1545af source code access fixed for apple:
Claus Gittinger
parents: 3067
diff changeset
  1479
                                    ^ memberFileName readStream
ebf6ad1545af source code access fixed for apple:
Claus Gittinger
parents: 3067
diff changeset
  1480
                                ].
3233
7bf7a8831ed9 Fixed assertions Java>>removeThread:for:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3214
diff changeset
  1481
                                OperatingSystem
3098
ebf6ad1545af source code access fixed for apple:
Claus Gittinger
parents: 3067
diff changeset
  1482
                                    executeCommand: ('unzip "%1" "%2"' bindWith: fn asAbsoluteFilename asString
ebf6ad1545af source code access fixed for apple:
Claus Gittinger
parents: 3067
diff changeset
  1483
                                    with: zipMemberName asString)
ebf6ad1545af source code access fixed for apple:
Claus Gittinger
parents: 3067
diff changeset
  1484
                                    inDirectory: cache asString.
ebf6ad1545af source code access fixed for apple:
Claus Gittinger
parents: 3067
diff changeset
  1485
                                (memberFileName := cache / zipMemberName) exists ifTrue: [
ebf6ad1545af source code access fixed for apple:
Claus Gittinger
parents: 3067
diff changeset
  1486
                                    ^ memberFileName readStream
2923
0be6bc618029 When accessing Java source in .har, try uncompress it using ZipArchive first...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2909
diff changeset
  1487
                                ]
2737
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1488
                            ]
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1489
                        ].
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1490
                        zar closeFile.
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1491
                    ]
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1492
                ]
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1493
    ].
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1494
    ^ nil
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1495
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1496
    "
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1497
 Java classSource: 'Object.java' package:'java/lang' in:'/home/jv/Projects/JavaX/java-6-openjdk/src'
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1498
 Java classSource: 'Object.java' package:'java/lang' in:'/usr/lib/jvm/java-6-openjdk/src.zip'"
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1499
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1500
    "Modified: / 29-03-1998 / 21:46:40 / cg"
83f8416e153c Cleanup. Change source API in `Java` to return stream rather than string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2732
diff changeset
  1501
    "Created: / 30-11-2010 / 12:32:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2923
0be6bc618029 When accessing Java source in .har, try uncompress it using ZipArchive first...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2909
diff changeset
  1502
    "Modified: / 15-11-2013 / 13:48:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1503
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1504
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1505
sourceDirectories
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1506
    ^self sourcePath
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1507
    "
3334
297cc823a07a Repository cleanup (3/7): removed obsolete eclipse projects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3324
diff changeset
  1508
	Java sourceDirectories 
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1509
    "
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1510
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1511
    "Modified: / 16-01-2013 / 12:46:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76
9ff95e14dbfb *** empty log message ***
cg
parents: 71
diff changeset
  1512
! !
9ff95e14dbfb *** empty log message ***
cg
parents: 71
diff changeset
  1513
224
164850a15533 moved main-startup into Java (useful for others too)
cg
parents: 215
diff changeset
  1514
!Java class methodsFor:'starting apps'!
164850a15533 moved main-startup into Java (useful for others too)
cg
parents: 215
diff changeset
  1515
164850a15533 moved main-startup into Java (useful for others too)
cg
parents: 215
diff changeset
  1516
javaProcessForMainOf:aJavaClass
164850a15533 moved main-startup into Java (useful for others too)
cg
parents: 215
diff changeset
  1517
    "ask for a commandLine, create a java process to invoke
164850a15533 moved main-startup into Java (useful for others too)
cg
parents: 215
diff changeset
  1518
     its main and return it. The process is not scheduled for
164850a15533 moved main-startup into Java (useful for others too)
cg
parents: 215
diff changeset
  1519
     execution."
164850a15533 moved main-startup into Java (useful for others too)
cg
parents: 215
diff changeset
  1520
508
21d8af9a9b41 checkin from browser
cg
parents: 494
diff changeset
  1521
    ^ self javaProcessForMainOf:aJavaClass argumentString:nil
224
164850a15533 moved main-startup into Java (useful for others too)
cg
parents: 215
diff changeset
  1522
508
21d8af9a9b41 checkin from browser
cg
parents: 494
diff changeset
  1523
    "Modified: / 30.12.1998 / 20:24:25 / cg"
224
164850a15533 moved main-startup into Java (useful for others too)
cg
parents: 215
diff changeset
  1524
!
164850a15533 moved main-startup into Java (useful for others too)
cg
parents: 215
diff changeset
  1525
508
21d8af9a9b41 checkin from browser
cg
parents: 494
diff changeset
  1526
javaProcessForMainOf:aJavaClass argumentString:argStringIn
224
164850a15533 moved main-startup into Java (useful for others too)
cg
parents: 215
diff changeset
  1527
    "create a java process, ready to invoke the classes main
164850a15533 moved main-startup into Java (useful for others too)
cg
parents: 215
diff changeset
  1528
     method. Returns the process - ready to run but not yet resumed"
164850a15533 moved main-startup into Java (useful for others too)
cg
parents: 215
diff changeset
  1529
2141
7d931f10c10c use collect:as:
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  1530
    |p argStringArray argString stdInReplacement alreadyAskedForStdin|
508
21d8af9a9b41 checkin from browser
cg
parents: 494
diff changeset
  1531
21d8af9a9b41 checkin from browser
cg
parents: 494
diff changeset
  1532
    argString := argStringIn.
21d8af9a9b41 checkin from browser
cg
parents: 494
diff changeset
  1533
    argString isNil ifTrue:[
2474
b05ce3206cf3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 2461
diff changeset
  1534
        argString := Dialog
b05ce3206cf3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 2461
diff changeset
  1535
                    request:'argument string:'
b05ce3206cf3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 2461
diff changeset
  1536
                    initialAnswer:LastArgumentString ? ''
b05ce3206cf3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 2461
diff changeset
  1537
                    onCancel:nil.
b05ce3206cf3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 2461
diff changeset
  1538
        argString isNil ifTrue:[^ nil].
508
21d8af9a9b41 checkin from browser
cg
parents: 494
diff changeset
  1539
2474
b05ce3206cf3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 2461
diff changeset
  1540
        LastArgumentString := argString.
508
21d8af9a9b41 checkin from browser
cg
parents: 494
diff changeset
  1541
    ].
224
164850a15533 moved main-startup into Java (useful for others too)
cg
parents: 215
diff changeset
  1542
261
d95d5a3cc475 lots of new stuff
cg
parents: 255
diff changeset
  1543
    JavaVM initializeVMIfNoEventThreadRunning.
d95d5a3cc475 lots of new stuff
cg
parents: 255
diff changeset
  1544
    (Java at:'java.lang.System') instVarNamed:'security' put:nil.
d95d5a3cc475 lots of new stuff
cg
parents: 255
diff changeset
  1545
224
164850a15533 moved main-startup into Java (useful for others too)
cg
parents: 215
diff changeset
  1546
    argString isEmpty ifTrue:[
2474
b05ce3206cf3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 2461
diff changeset
  1547
        argStringArray := #()
224
164850a15533 moved main-startup into Java (useful for others too)
cg
parents: 215
diff changeset
  1548
    ] ifFalse:[
2474
b05ce3206cf3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 2461
diff changeset
  1549
        argStringArray := (argString asCollectionOfWords collect:[:s | Java as_String:s]) asArray.
224
164850a15533 moved main-startup into Java (useful for others too)
cg
parents: 215
diff changeset
  1550
    ].
164850a15533 moved main-startup into Java (useful for others too)
cg
parents: 215
diff changeset
  1551
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1552
    p := JavaProcess
2474
b05ce3206cf3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 2461
diff changeset
  1553
            for:[
b05ce3206cf3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 2461
diff changeset
  1554
                    "/ if the program reads from stdin, let user provide a file
b05ce3206cf3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 2461
diff changeset
  1555
                    "/ for it.
b05ce3206cf3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 2461
diff changeset
  1556
                    JavaVM stdinReplacementFileQuerySignal handle:[:ex |
b05ce3206cf3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 2461
diff changeset
  1557
                        |fn|
577
18407fb4087b provide Stdin replacement;
cg
parents: 571
diff changeset
  1558
2474
b05ce3206cf3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 2461
diff changeset
  1559
                        alreadyAskedForStdin == true ifFalse:[
b05ce3206cf3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 2461
diff changeset
  1560
                            fn := Dialog
b05ce3206cf3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 2461
diff changeset
  1561
                                    requestFileName:'Program reads from Stdin - give inputFile or cancel for EOF'
b05ce3206cf3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 2461
diff changeset
  1562
                                    default:nil
b05ce3206cf3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 2461
diff changeset
  1563
                                    fromDirectory:(FileSelectionBox lastFileSelectionDirectory).
b05ce3206cf3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 2461
diff changeset
  1564
                            fn notNil ifTrue:[
b05ce3206cf3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 2461
diff changeset
  1565
                                stdInReplacement := fn asFilename readStream.
b05ce3206cf3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 2461
diff changeset
  1566
                            ].
b05ce3206cf3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 2461
diff changeset
  1567
                            alreadyAskedForStdin := true.
b05ce3206cf3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 2461
diff changeset
  1568
                        ].
b05ce3206cf3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 2461
diff changeset
  1569
                        ex proceedWith:stdInReplacement
b05ce3206cf3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 2461
diff changeset
  1570
                    ] do:[
b05ce3206cf3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 2461
diff changeset
  1571
                        aJavaClass
b05ce3206cf3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 2461
diff changeset
  1572
                            performStatic:#'main([Ljava/lang/String;)V'
b05ce3206cf3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 2461
diff changeset
  1573
                            with:argStringArray.
b05ce3206cf3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 2461
diff changeset
  1574
                    ]
b05ce3206cf3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 2461
diff changeset
  1575
                ]
b05ce3206cf3 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 2461
diff changeset
  1576
            priority:(Processor activePriority - 1).
224
164850a15533 moved main-startup into Java (useful for others too)
cg
parents: 215
diff changeset
  1577
164850a15533 moved main-startup into Java (useful for others too)
cg
parents: 215
diff changeset
  1578
    p name:(aJavaClass fullName , '::main()').
654
da8d060a3150 checkin from browser
cg
parents: 648
diff changeset
  1579
    p restartable:true.
224
164850a15533 moved main-startup into Java (useful for others too)
cg
parents: 215
diff changeset
  1580
    ^ p
164850a15533 moved main-startup into Java (useful for others too)
cg
parents: 215
diff changeset
  1581
252
04b330744577 new javaVM stuff & back to pre-stefans changes
cg
parents: 248
diff changeset
  1582
    "Created: / 15.8.1997 / 04:41:20 / cg"
654
da8d060a3150 checkin from browser
cg
parents: 648
diff changeset
  1583
    "Modified: / 24.12.1999 / 01:50:21 / cg"
224
164850a15533 moved main-startup into Java (useful for others too)
cg
parents: 215
diff changeset
  1584
! !
164850a15533 moved main-startup into Java (useful for others too)
cg
parents: 215
diff changeset
  1585
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1586
!Java class methodsFor:'threads'!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1587
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1588
addThread: jThread for: stProcess
3214
c38fcee7b0da Fixes bad bug in Java thread handling that caused memory/resource leak.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3196
diff changeset
  1589
    ThreadsAccess critical: [
c38fcee7b0da Fixes bad bug in Java thread handling that caused memory/resource leak.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3196
diff changeset
  1590
        self assert: (Threads includesKey: jThread) not.
c38fcee7b0da Fixes bad bug in Java thread handling that caused memory/resource leak.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3196
diff changeset
  1591
        jThread == 0 ifTrue: [self breakPoint:#mh].
c38fcee7b0da Fixes bad bug in Java thread handling that caused memory/resource leak.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3196
diff changeset
  1592
        Threads at: jThread put: stProcess.
3233
7bf7a8831ed9 Fixed assertions Java>>removeThread:for:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3214
diff changeset
  1593
        stProcess addExitAction: [
3214
c38fcee7b0da Fixes bad bug in Java thread handling that caused memory/resource leak.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3196
diff changeset
  1594
            self removeThread: jThread for: stProcess
c38fcee7b0da Fixes bad bug in Java thread handling that caused memory/resource leak.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3196
diff changeset
  1595
        ].
c38fcee7b0da Fixes bad bug in Java thread handling that caused memory/resource leak.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3196
diff changeset
  1596
    ]
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1597
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1598
    "Created: / 26-08-1997 / 19:53:57 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1599
    "Created: / 09-12-2011 / 12:47:10 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
3214
c38fcee7b0da Fixes bad bug in Java thread handling that caused memory/resource leak.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3196
diff changeset
  1600
    "Modified: / 08-08-2014 / 08:57:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1601
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1602
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1603
initializeCurrentThread
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1604
    "adds current thread into known threads"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1605
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1606
    | thisProcess  jThread |
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1607
    thisProcess := Processor activeProcess.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1608
    jThread := JavaVM newThread: thisProcess name.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1609
    jThread instVarNamed: 'tid' put: thisProcess id.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1610
    Java addThread: jThread for: thisProcess.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1611
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1612
    "Created: / 09-12-2011 / 12:08:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1613
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1614
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1615
removeThread: jThread for: stProcess
3214
c38fcee7b0da Fixes bad bug in Java thread handling that caused memory/resource leak.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3196
diff changeset
  1616
    ThreadsAccess critical: [
3308
b0f4e406b42d Fix in flushing Java - flush smalltalk-to-java thread object mapping...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3296
diff changeset
  1617
        self assert: ((Threads includesKey: jThread) not or:[(Threads at: jThread) == stProcess]).
3233
7bf7a8831ed9 Fixed assertions Java>>removeThread:for:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3214
diff changeset
  1618
        Threads removeKey: jThread ifAbsent:nil.
3214
c38fcee7b0da Fixes bad bug in Java thread handling that caused memory/resource leak.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3196
diff changeset
  1619
    ]
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1620
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1621
    "Created: / 26-08-1997 / 19:53:57 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1622
    "Created: / 09-12-2011 / 12:47:32 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
3308
b0f4e406b42d Fix in flushing Java - flush smalltalk-to-java thread object mapping...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3296
diff changeset
  1623
    "Modified: / 17-12-2014 / 00:28:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1624
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1625
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1626
threadForStProcess: stProcess
3214
c38fcee7b0da Fixes bad bug in Java thread handling that caused memory/resource leak.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3196
diff changeset
  1627
    ^ ThreadsAccess critical: [ Threads keyAtValue: stProcess ].
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1628
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1629
    "Created: / 26-08-1997 / 19:53:57 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1630
    "Created: / 09-12-2011 / 12:50:58 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
3214
c38fcee7b0da Fixes bad bug in Java thread handling that caused memory/resource leak.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3196
diff changeset
  1631
    "Modified: / 08-08-2014 / 09:25:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1632
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1633
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1634
threadForStProcess: stProcess ifAbsent: block
3214
c38fcee7b0da Fixes bad bug in Java thread handling that caused memory/resource leak.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3196
diff changeset
  1635
    ^ ThreadsAccess critical: [ Threads keyAtValue: stProcess ifAbsent: block ].
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1636
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1637
    "Created: / 26-08-1997 / 19:53:57 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1638
    "Created: / 09-12-2011 / 12:53:11 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
3214
c38fcee7b0da Fixes bad bug in Java thread handling that caused memory/resource leak.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3196
diff changeset
  1639
    "Modified (format): / 08-08-2014 / 09:25:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1640
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1641
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1642
threads
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1643
    self breakPoint:#mh.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1644
    ^ Threads.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1645
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1646
    "Created: / 26-08-1997 / 19:53:57 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1647
    "Modified: / 09-12-2011 / 12:49:43 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1648
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1649
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1650
threadsAt: key
3214
c38fcee7b0da Fixes bad bug in Java thread handling that caused memory/resource leak.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3196
diff changeset
  1651
    ^ ThreadsAccess critical:[ Threads at: key ]
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1652
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1653
    "Created: / 26-08-1997 / 19:53:57 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1654
    "Created: / 09-12-2011 / 12:31:56 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
3214
c38fcee7b0da Fixes bad bug in Java thread handling that caused memory/resource leak.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3196
diff changeset
  1655
    "Modified: / 08-08-2014 / 09:24:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1656
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1657
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1658
threadsAt: key ifAbsent: block
3214
c38fcee7b0da Fixes bad bug in Java thread handling that caused memory/resource leak.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3196
diff changeset
  1659
    ^ ThreadsAccess critical: [ Threads at: key ifAbsent: block ]
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1660
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1661
    "Created: / 26-08-1997 / 19:53:57 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1662
    "Created: / 09-12-2011 / 12:49:22 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
3214
c38fcee7b0da Fixes bad bug in Java thread handling that caused memory/resource leak.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3196
diff changeset
  1663
    "Modified: / 08-08-2014 / 09:24:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1664
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1665
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1666
threadsDo: block
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1667
    ThreadsAccess
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1668
	    critical: [ Threads do: block]
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1669
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1670
    "Created: / 26-08-1997 / 19:53:57 / cg"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1671
    "Created: / 09-12-2011 / 12:49:00 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1672
! !
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1673
135
098936234135 *** empty log message ***
cg
parents: 121
diff changeset
  1674
!Java class methodsFor:'documentation'!
17
ea80d8a83063 intitial checkin
cg
parents:
diff changeset
  1675
ea80d8a83063 intitial checkin
cg
parents:
diff changeset
  1676
version
3561
dd3b2c322d9b #REFACTORING by mawalch
mawalch
parents: 3443
diff changeset
  1677
    ^ '$Header$'
2279
6f65ccfd7c81 fixed: #version_SVN ($ to §)
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1678
!
6f65ccfd7c81 fixed: #version_SVN ($ to §)
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1679
6f65ccfd7c81 fixed: #version_SVN ($ to §)
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1680
version_CVS
3561
dd3b2c322d9b #REFACTORING by mawalch
mawalch
parents: 3443
diff changeset
  1681
    ^ '$Header$'
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
  1682
!
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
  1683
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2141
diff changeset
  1684
version_SVN
3561
dd3b2c322d9b #REFACTORING by mawalch
mawalch
parents: 3443
diff changeset
  1685
    ^ '$Id$'
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1686
17
ea80d8a83063 intitial checkin
cg
parents:
diff changeset
  1687
! !
2108
ca8c4e7db2e8 category change
Claus Gittinger <cg@exept.de>
parents: 2105
diff changeset
  1688
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2279
diff changeset
  1689
2088
d654e34676d7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
  1690
Java initialize!