--- a/JavaBehavior.st Sat Mar 20 20:27:50 2004 +0100
+++ b/JavaBehavior.st Fri Aug 12 18:31:06 2005 +0200
@@ -1,10 +1,6 @@
"
- COPYRIGHT (c) 1996-2011 by Claus Gittinger
- COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
- SWING Research Group, Czech Technical University in Prague
-
- Parts of the code written by Claus Gittinger are under following
- license:
+ COPYRIGHT (c) 2005 by eXept Software AG
+ All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
@@ -12,40 +8,15 @@
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
-
- Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
-
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation
- files (the 'Software'), to deal in the Software without
- restriction, including without limitation the rights to use,
- copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following
- conditions:
+"
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
-
- [1] Code written at SWING Research Group contain a signature
- of one of the above copright owners.
-"
"{ Package: 'stx:libjava' }"
Class subclass:#JavaBehavior
instanceVariableNames:'constantPool interfaces accessFlags'
classVariableNames:'InitialValuePerType A_OBSOLETE A_INTERFACE A_PUBLIC A_FINAL
A_ABSTRACT A_INITIALIZED A_SMALLTALK A_ABSTRACT_OR_INTERFACE
- A_STATIC A_NATIVE A_SYNTHETIC A_ANNOTATION A_ENUM'
+ A_STATIC A_NATIVE'
poolDictionaries:''
category:'Languages-Java-Classes'
!
@@ -54,12 +25,8 @@
copyright
"
- COPYRIGHT (c) 1996-2011 by Claus Gittinger
- COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
- SWING Research Group, Czech Technical University in Prague
-
- Parts of the code written by Claus Gittinger are under following
- license:
+ COPYRIGHT (c) 2005 by eXept Software AG
+ All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
@@ -67,33 +34,6 @@
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
-
- Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
-
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation
- files (the 'Software'), to deal in the Software without
- restriction, including without limitation the rights to use,
- copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following
- conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
-
- [1] Code written at SWING Research Group contain a signature
- of one of the above copright owners.
-
"
!
@@ -120,9 +60,6 @@
A_INTERFACE := 16r000200.
A_ABSTRACT := 16r000400.
- A_SYNTHETIC := 16r001000. "/ 1.1
- A_ANNOTATION := 16r002000. "/ 1.1
- A_ENUM := 16r004000. "/ 1.1
A_OBSOLETE := 16r008000.
"/ those are local to the ST/X implementation
@@ -198,10 +135,6 @@
!JavaBehavior methodsFor:'accessing'!
-accessFlags
- ^ accessFlags
-!
-
constantPool
^ constantPool
!
@@ -219,15 +152,6 @@
^ interfaces
! !
-!JavaBehavior methodsFor:'compiler interface'!
-
-programmingLanguage
-
- ^JavaLanguage instance
-
- "Created: / 26-10-2010 / 23:42:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
!JavaBehavior methodsFor:'private accessing'!
makeObsolete
@@ -248,12 +172,10 @@
"Created: 15.4.1996 / 16:42:52 / cg"
!
-setConstantPool: aJavaConstantPool
- constantPool := aJavaConstantPool.
- constantPool ifNotNil:[constantPool owner: self].
+setConstantPool:anArray
+ constantPool := anArray.
- "Created: / 15-04-1996 / 16:42:52 / cg"
- "Modified: / 22-05-2011 / 13:16:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Created: 15.4.1996 / 16:42:52 / cg"
!
setInterfaces:i
@@ -264,7 +186,7 @@
]
"Modified: 7.4.1997 / 15:44:53 / cg"
-! !
+!
!JavaBehavior methodsFor:'queries'!
@@ -349,15 +271,7 @@
!JavaBehavior class methodsFor:'documentation'!
version
- ^ '$Id: /cvs/stx/stx/libjava/JavaBehavior.st,v 1.4 2011/08/18 18:42:48 vrany Exp $'
-!
-
-version_CVS
- ^ '§Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaBehavior.st,v 1.3 2009/10/09 14:04:26 cg Exp §'
-!
-
-version_SVN
- ^ '$Id: JavaBehavior.st,v 1.4 2011/08/18 18:42:48 vrany Exp $'
+ ^ '$Header: /cvs/stx/stx/libjava/JavaBehavior.st,v 1.1 2005-08-12 16:31:06 cg Exp $'
! !
-JavaBehavior initialize!
\ No newline at end of file
+JavaBehavior initialize!
--- a/JavaClass.st Sat Mar 20 20:27:50 2004 +0100
+++ b/JavaClass.st Fri Aug 12 18:31:06 2005 +0200
@@ -1,6 +1,6 @@
"
COPYRIGHT (c) 1997 by eXept Software AG
- All Rights Reserved
+ All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
@@ -10,17 +10,12 @@
hereby transferred.
"
-
-
-
"{ Package: 'stx:libjava' }"
-Class subclass:#JavaClass
- instanceVariableNames:'constantPool interfaces accessFlags classLoader fullName
+JavaBehavior subclass:#JavaClass
+ instanceVariableNames:'classLoader fullName
sourceFile binaryFilePath fields initValues staticFields'
- classVariableNames:'InitialValuePerType A_OBSOLETE A_INTERFACE A_PUBLIC A_FINAL
- A_ABSTRACT A_INITIALIZED A_SMALLTALK A_ABSTRACT_OR_INTERFACE
- A_STATIC A_NATIVE ArgumentConversionErrorSignal OrderOfClassInits'
+ classVariableNames:'ArgumentConversionErrorSignal OrderOfClassInits'
poolDictionaries:''
category:'Languages-Java-Classes'
!
@@ -30,7 +25,7 @@
copyright
"
COPYRIGHT (c) 1997 by eXept Software AG
- All Rights Reserved
+ All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
@@ -39,9 +34,6 @@
other person. No title to or ownership of the software is
hereby transferred.
"
-
-
-
!
documentation
@@ -58,52 +50,6 @@
"
! !
-!JavaClass class methodsFor:'initialization'!
-
-initialize
- "/ those are defined in Java and read from the classFile
- A_PUBLIC := 16r000001.
- "/ A_PRIVATE := 16r000002.
- "/ A_PROTECTED := 16r000004.
- A_STATIC := 16r000008.
- A_FINAL := 16r000010.
- "/ A_SUPER := 16r000020.
- "/ A_SYNCHRONIZED := 16r000020.
- "/ A_VOLATILE := 16r000040.
- "/ A_TRANSIENT := 16r000080.
- A_NATIVE := 16r000100.
-
- A_INTERFACE := 16r000200.
- A_ABSTRACT := 16r000400.
- A_OBSOLETE := 16r008000.
-
- "/ those are local to the ST/X implementation
- A_INITIALIZED := 16r100000.
- A_SMALLTALK := 16r200000.
-
- A_ABSTRACT_OR_INTERFACE := A_ABSTRACT bitOr:A_INTERFACE.
-
- InitialValuePerType := IdentityDictionary new.
- InitialValuePerType at:$B put:0.
- InitialValuePerType at:$C put:0.
- InitialValuePerType at:$D put:0.0.
- InitialValuePerType at:$F put:(0.0 asShortFloat).
- InitialValuePerType at:$I put:0.
- InitialValuePerType at:$J put:0.
- InitialValuePerType at:$S put:0.
- InitialValuePerType at:$Z put:0.
- InitialValuePerType at:$L put:nil.
- InitialValuePerType at:$[ put:nil.
-
- ArgumentConversionErrorSignal := ErrorSignal newSignal mayProceed:true.
-
- "
- JavaClass initialize
- "
-
- "Modified: / 13.11.1998 / 14:09:52 / cg"
-! !
-
!JavaClass class methodsFor:'instance creation'!
fullName:aString
@@ -117,7 +63,7 @@
"/ check for a JAVA nameSpace to exist
JAVA isNil ifTrue:[
- NameSpace name:'JAVA'
+ NameSpace name:'JAVA'
].
"create the metaclass first"
@@ -148,14 +94,14 @@
nameComponents := aString asCollectionOfSubstringsSeparatedBy:$/.
nameComponents size > 1 ifTrue:[
- cls category:((nameComponents asStringWith:$/ from:1 to:(nameComponents size - 1))
- replaceAll:$/ with:$. ).
+ cls category:((nameComponents asStringWith:$/ from:1 to:(nameComponents size - 1))
+ replaceAll:$/ with:$. ).
].
nameComponents size > 1 ifTrue:[
- cls setPackage:((nameComponents copyWithoutLast:1) asStringWith:$/) asSymbol
+ cls setPackage:((nameComponents copyWithoutLast:1) asStringWith:$/) asSymbol
] ifFalse:[
- cls setPackage:aString asSymbol
+ cls setPackage:aString asSymbol
].
"/ break up the package and create nameSpaces
@@ -166,20 +112,20 @@
ns := JAVA.
nameComponents size > 1 ifTrue:[
- s := '' writeStream.
- s nextPutAll:'JAVA'.
- nameComponents from:1 to:(nameComponents size - 1) do:[:aPart |
- s nextPutAll:'::'.
- s nextPutAll:aPart
- ].
- Metaclass confirmationQuerySignal answer:false do:[
- Class updateChangeFileQuerySignal answer:false do:[
- ns := NameSpace fullName:(s contents).
- ]
- ]
+ s := '' writeStream.
+ s nextPutAll:'JAVA'.
+ nameComponents from:1 to:(nameComponents size - 1) do:[:aPart |
+ s nextPutAll:'::'.
+ s nextPutAll:aPart
+ ].
+ Metaclass confirmationQuerySignal answer:false do:[
+ Class updateChangeFileQuerySignal answer:false do:[
+ ns := NameSpace fullName:(s contents).
+ ]
+ ]
].
ns isNameSpace ifTrue:[
- ns at:nameComponents last asSymbol put:cls.
+ ns at:nameComponents last asSymbol put:cls.
].
"/ for ST/X browsing
@@ -197,38 +143,18 @@
"Created: 15.4.1996 / 15:52:55 / cg"
! !
-!JavaClass class methodsFor:'constants'!
-
-A_NATIVE
- ^ A_NATIVE
-
- "Created: / 16.5.1998 / 01:18:43 / cg"
-!
-
-A_PUBLIC
- ^ A_PUBLIC
-
- "Created: / 13.5.1998 / 13:03:18 / cg"
-!
-
-A_STATIC
- ^ A_STATIC
-
- "Created: / 16.5.1998 / 00:02:07 / cg"
-! !
-
!JavaClass class methodsFor:'method lookup'!
canConvertArgsToJava:argArray asSpecifiedIn:argSigSpecArray
"given a smalltalk argument array, return true, if these can be converted to java objects as appropriate."
- argArray
- with:argSigSpecArray
- do:[:arg :type |
- self
- convertToJava:arg
- type:type
- ifFail:[:msg :default| ^ false]].
+ argArray
+ with:argSigSpecArray
+ do:[:arg :type |
+ self
+ convertToJava:arg
+ type:type
+ ifFail:[:msg :default| ^ false]].
^ true
"Created: / 5.11.1998 / 18:25:05 / cg"
@@ -245,20 +171,20 @@
newArgArray := Array new:na.
argArray do:[:arg |
- |type newArg|
+ |type newArg|
- type := argSigSpecArray at:sigIndex.
- sigIndex := sigIndex + 1.
- newArg := self convertToJava:arg type:type.
- newArgArray at:newArgIndex put:newArg.
- newArgIndex := newArgIndex + 1.
- (type == #long or:[type == #double]) ifTrue:[
- newArgIndex > na ifTrue:[
- self halt:'should not happen'
- ].
- newArgArray at:newArgIndex put:nil.
- newArgIndex := newArgIndex + 1.
- ]
+ type := argSigSpecArray at:sigIndex.
+ sigIndex := sigIndex + 1.
+ newArg := self convertToJava:arg type:type.
+ newArgArray at:newArgIndex put:newArg.
+ newArgIndex := newArgIndex + 1.
+ (type == #long or:[type == #double]) ifTrue:[
+ newArgIndex > na ifTrue:[
+ self halt:'should not happen'
+ ].
+ newArgArray at:newArgIndex put:nil.
+ newArgIndex := newArgIndex + 1.
+ ]
].
^ newArgArray
@@ -270,15 +196,15 @@
convertToJava:arg type:type
"given a smalltalk argument, convert to a java object as appropriate."
- ^ self
- convertToJava:arg
- type:type
- ifFail:[:msg :default |
- ArgumentConversionErrorSignal
- raiseWith:arg
- errorString:msg.
- default
- ]
+ ^ self
+ convertToJava:arg
+ type:type
+ ifFail:[:msg :default |
+ ArgumentConversionErrorSignal
+ raiseWith:arg
+ errorString:msg.
+ default
+ ]
"Modified: / 5.11.1998 / 18:43:33 / cg"
"Created: / 6.11.1998 / 00:45:13 / cg"
@@ -291,132 +217,132 @@
|expectedCls f failValue|
type == #boolean ifTrue:[
- arg == true ifTrue:[
- ^ 1
- ].
- arg == false ifTrue:[
- ^ 0
- ].
- ^ failBlock value:('cannot convert argument to ' , type) value:0
+ arg == true ifTrue:[
+ ^ 1
+ ].
+ arg == false ifTrue:[
+ ^ 0
+ ].
+ ^ failBlock value:('cannot convert argument to ' , type) value:0
].
type == #int ifTrue:[
- arg isInteger ifTrue:[
- (arg between:-16r8000000 and:16r7FFFFFFF) ifTrue:[
- ^ arg
- ].
- ^ failBlock value:('integer range; cannot convert argument to ' , type) value:0.
- ].
- ^ failBlock value:('cannot convert argument to ' , type) value:0
+ arg isInteger ifTrue:[
+ (arg between:-16r8000000 and:16r7FFFFFFF) ifTrue:[
+ ^ arg
+ ].
+ ^ failBlock value:('integer range; cannot convert argument to ' , type) value:0.
+ ].
+ ^ failBlock value:('cannot convert argument to ' , type) value:0
].
type == #long ifTrue:[
- arg isInteger ifTrue:[
- (arg between:-16r800000000000000 and:16r7FFFFFFFFFFFFFFF) ifTrue:[
- ^ arg
- ].
- ^ failBlock value:('integer range; cannot convert argument to ' , type) value:0
- ].
- ^ failBlock value:('cannot convert argument to ' , type) value:0
+ arg isInteger ifTrue:[
+ (arg between:-16r800000000000000 and:16r7FFFFFFFFFFFFFFF) ifTrue:[
+ ^ arg
+ ].
+ ^ failBlock value:('integer range; cannot convert argument to ' , type) value:0
+ ].
+ ^ failBlock value:('cannot convert argument to ' , type) value:0
].
(type == #float) ifTrue:[
- arg isLimitedPrecisionReal ifTrue:[
- ^ arg asShortFloat
- ].
- ^ failBlock value:('cannot convert argument to ' , type) value:0.0.
+ arg isLimitedPrecisionReal ifTrue:[
+ ^ arg asShortFloat
+ ].
+ ^ failBlock value:('cannot convert argument to ' , type) value:0.0.
].
(type = 'java.lang.Float') ifTrue:[
- arg isLimitedPrecisionReal ifTrue:[
- f := (Java at:'java.lang.Float') new.
- f perform:#'<init>(F)V' with:(arg asShortFloat).
+ arg isLimitedPrecisionReal ifTrue:[
+ f := (Java at:'java.lang.Float') new.
+ f perform:#'<init>(F)V' with:(arg asShortFloat).
self halt.
- ^ f.
- ].
- ^ failBlock value:('cannot convert argument to ' , type) value:0.0.
+ ^ f.
+ ].
+ ^ failBlock value:('cannot convert argument to ' , type) value:0.0.
].
(type = 'java.lang.Double') ifTrue:[
- arg isLimitedPrecisionReal ifTrue:[
- f := (Java at:'java.lang.Double') new.
- f perform:#'<init>(D)V' with:(arg asFloat).
+ arg isLimitedPrecisionReal ifTrue:[
+ f := (Java at:'java.lang.Double') new.
+ f perform:#'<init>(D)V' with:(arg asFloat).
self halt.
- ^ f.
- ].
- ^ failBlock value:('cannot convert argument to ' , type) value:0.0.
+ ^ f.
+ ].
+ ^ failBlock value:('cannot convert argument to ' , type) value:0.0.
].
(type == #double) ifTrue:[
- arg isLimitedPrecisionReal ifTrue:[
- ^ arg asFloat
- ].
- ^ failBlock value:('cannot convert argument to ' , type) value:0.0.
+ arg isLimitedPrecisionReal ifTrue:[
+ ^ arg asFloat
+ ].
+ ^ failBlock value:('cannot convert argument to ' , type) value:0.0.
].
(type == #char) ifTrue:[
- arg isCharacter ifTrue:[
- ^ arg asciiValue
- ].
- ^ failBlock value:('cannot convert argument to ' , type) value:0
- ].
+ arg isCharacter ifTrue:[
+ ^ arg asciiValue
+ ].
+ ^ failBlock value:('cannot convert argument to ' , type) value:0
+ ].
(type = 'char[]') ifTrue:[
- arg isString ifTrue:[
- ^ arg
- ].
- ^ failBlock value:('cannot convert argument to ' , type) value:''
- ].
+ arg isString ifTrue:[
+ ^ arg
+ ].
+ ^ failBlock value:('cannot convert argument to ' , type) value:''
+ ].
(type = 'int[]') ifTrue:[
- (arg isArray or:[arg isMemberOf:SignedIntegerArray]) ifTrue:[
- ^ arg
- ].
- ^ failBlock value:('cannot convert argument to ' , type) value:''
- ].
+ (arg isArray or:[arg isMemberOf:SignedIntegerArray]) ifTrue:[
+ ^ arg
+ ].
+ ^ failBlock value:('cannot convert argument to ' , type) value:''
+ ].
(type = 'long[]') ifTrue:[
- (arg isArray or:[arg isMemberOf:SignedIntegerArray]) ifTrue:[
- ^ arg
- ].
- ^ failBlock value:('cannot convert argument to ' , type) value:''
- ].
+ (arg isArray or:[arg isMemberOf:SignedIntegerArray]) ifTrue:[
+ ^ arg
+ ].
+ ^ failBlock value:('cannot convert argument to ' , type) value:''
+ ].
(type = 'float[]') ifTrue:[
- (arg isArray or:[arg isMemberOf:FloatArray]) ifTrue:[
- ^ arg
- ].
- ^ failBlock value:('cannot convert argument to ' , type) value:''
- ].
+ (arg isArray or:[arg isMemberOf:FloatArray]) ifTrue:[
+ ^ arg
+ ].
+ ^ failBlock value:('cannot convert argument to ' , type) value:''
+ ].
(type = 'double[]') ifTrue:[
- (arg isArray or:[arg isMemberOf:DoubleArray]) ifTrue:[
- ^ arg
- ].
- ^ failBlock value:('cannot convert argument to ' , type) value:''
- ].
+ (arg isArray or:[arg isMemberOf:DoubleArray]) ifTrue:[
+ ^ arg
+ ].
+ ^ failBlock value:('cannot convert argument to ' , type) value:''
+ ].
(type endsWith:'[]') ifTrue:[
- (arg isArray or:[arg isNil]) ifTrue:[
- ^ arg
- ].
- ^ failBlock value:('cannot convert argument to ' , type) value:''
+ (arg isArray or:[arg isNil]) ifTrue:[
+ ^ arg
+ ].
+ ^ failBlock value:('cannot convert argument to ' , type) value:''
].
(type = 'java.lang.Object') ifTrue:[
- "/ matches any
- ^ arg
+ "/ matches any
+ ^ arg
].
(type = 'java.lang.String') ifTrue:[
- arg isString ifTrue:[
- ^ Java as_String:arg
- ].
- failValue := ''
+ arg isString ifTrue:[
+ ^ Java as_String:arg
+ ].
+ failValue := ''
].
expectedCls := Java classForName:type.
(arg isKindOf:expectedCls) ifTrue:[
- "/ matches class and subclasses
- ^ arg
+ "/ matches class and subclasses
+ ^ arg
].
arg isNil ifTrue:[
- "/ matches any
- ^ arg
+ "/ matches any
+ ^ arg
].
self halt.
^ failBlock value:('cannot convert argument to ' , type) value:failValue
@@ -425,23 +351,23 @@
"Modified: / 6.11.2001 / 13:28:29 / cg"
!
-convertToSmalltalk:jObj type:type
+convertToSmalltalk:jObj type:type
"given a java return value, convert to a smalltalk object as appropriate.
Currently, only a few types are converted."
type == #boolean ifTrue:[
- jObj == 0 ifTrue:[
- ^ false
- ].
- ^ true
+ jObj == 0 ifTrue:[
+ ^ false
+ ].
+ ^ true
].
type == #void ifTrue:[
- ^ nil
+ ^ nil
].
(type = 'java.lang.String') ifTrue:[
- ^ Java as_ST_String:jObj
+ ^ Java as_ST_String:jObj
].
"/ (type = 'java.lang.Float') ifTrue:[
@@ -452,10 +378,10 @@
"/ ].
(type == #char) ifTrue:[
- jObj isInteger ifTrue:[
- ^ Character value:jObj
- ].
- ].
+ jObj isInteger ifTrue:[
+ ^ Character value:jObj
+ ].
+ ].
^ jObj
@@ -470,38 +396,38 @@
sel := selector.
(sel includes:$:) ifTrue:[
- sel := sel copyTo:(sel indexOf:$:)-1
+ sel := sel copyTo:(sel indexOf:$:)-1
].
sel := sel asSymbolIfInterned.
sel notNil ifTrue:[
- cls := aClass.
+ cls := aClass.
- [cls notNil
- and:[cls ~~ JavaObject
- and:[cls ~~ JavaClass]]] whileTrue:[
- cls methodDictionary keysAndValuesDo:[:jSel :m |
- |aMethod|
+ [cls notNil
+ and:[cls ~~ JavaObject
+ and:[cls ~~ JavaClass]]] whileTrue:[
+ cls methodDictionary keysAndValuesDo:[:jSel :m |
+ |aMethod|
+
+ aMethod := m.
+ aMethod isWrapped ifTrue:[
+ aMethod := aMethod originalMethod
+ ].
- aMethod := m.
- aMethod isWrapped ifTrue:[
- aMethod := aMethod originalMethod
- ].
-
- ((jSel == sel)
- or:[aMethod name = sel
- or:[aMethod signatureNameWithoutReturnType = sel]])
- ifTrue:[
- aMethod numArgs == nargs ifTrue:[
- staticMethod == (aMethod isStatic) ifTrue:[
- ^ m
- ]
- ]
- ]
- ].
+ ((jSel == sel)
+ or:[aMethod name = sel
+ or:[aMethod signatureNameWithoutReturnType = sel]])
+ ifTrue:[
+ aMethod numArgs == nargs ifTrue:[
+ staticMethod == (aMethod isStatic) ifTrue:[
+ ^ m
+ ]
+ ]
+ ]
+ ].
- cls := cls superclass.
- ].
+ cls := cls superclass.
+ ].
].
"/ self halt.
^ nil
@@ -519,35 +445,35 @@
sel := selector.
(sel includes:$:) ifTrue:[
- sel := sel copyTo:(sel indexOf:$:)-1
+ sel := sel copyTo:(sel indexOf:$:)-1
].
sel := sel asSymbolIfInterned.
sel notNil ifTrue:[
- cls := aClass.
+ cls := aClass.
- [cls notNil
- and:[cls ~~ JavaObject
- and:[cls ~~ JavaClass]]] whileTrue:[
- cls methodDictionary keysAndValuesDo:[:jSel :aMethod |
- ((jSel == sel)
- or:[aMethod name = sel
- or:[aMethod signatureNameWithoutReturnType = sel]])
- ifTrue:[
- (nargs isNil
- or:[aMethod numArgs == nargs]) ifTrue:[
- staticMethod == (aMethod isStatic) ifTrue:[
- methods isNil ifTrue:[
- methods := OrderedCollection new
- ].
- methods add:aMethod
- ]
- ]
- ]
- ].
+ [cls notNil
+ and:[cls ~~ JavaObject
+ and:[cls ~~ JavaClass]]] whileTrue:[
+ cls methodDictionary keysAndValuesDo:[:jSel :aMethod |
+ ((jSel == sel)
+ or:[aMethod name = sel
+ or:[aMethod signatureNameWithoutReturnType = sel]])
+ ifTrue:[
+ (nargs isNil
+ or:[aMethod numArgs == nargs]) ifTrue:[
+ staticMethod == (aMethod isStatic) ifTrue:[
+ methods isNil ifTrue:[
+ methods := OrderedCollection new
+ ].
+ methods add:aMethod
+ ]
+ ]
+ ]
+ ].
- cls := cls superclass.
- ].
+ cls := cls superclass.
+ ].
].
^ methods ? #()
@@ -566,21 +492,12 @@
^ self initialValueFromStream:s.
"
- JavaClass initialValueFromSignature:'LObject;'
- JavaClass initialValueFromSignature:'B'
- JavaClass initialValueFromSignature:'I'
+ JavaClass initialValueFromSignature:'LObject;'
+ JavaClass initialValueFromSignature:'B'
+ JavaClass initialValueFromSignature:'I'
"
-!
-
-initialValueFromStream:s
- "parse a fieldTypeSpec - see java doc"
-
- |typeChar|
-
- typeChar := s next.
- ^ InitialValuePerType at:typeChar ifAbsent:nil.
! !
!JavaClass class methodsFor:'special'!
@@ -631,10 +548,10 @@
nameComponents := fullName asCollectionOfSubstringsSeparatedBy:$/.
nameComponents size <= 1 ifTrue:[
- ^ 'java' "/ fullName
+ ^ 'java' "/ fullName
].
- ^ ((nameComponents asStringWith:$/ from:1 to:(nameComponents size - 1)))
- replaceAll:$/ with:$.
+ ^ ((nameComponents asStringWith:$/ from:1 to:(nameComponents size - 1)))
+ replaceAll:$/ with:$.
"Modified: 30.7.1997 / 15:35:22 / cg"
!
@@ -654,9 +571,9 @@
m := super compiledMethodAt:name.
m isNil ifTrue:[
- name = self lastName ifTrue:[
- ^ super compiledMethodAt:#'<init>()V'
- ].
+ name = self lastName ifTrue:[
+ ^ super compiledMethodAt:#'<init>()V'
+ ].
].
^ m
@@ -719,11 +636,11 @@
^ fullName copyReplaceAll:$/ with:$.
"
- Java allClasses first fullName
- Java allClasses first name
- Java allClasses first javaName
- Java allClasses first javaPackage
- Java allClasses first package
+ Java allClasses first fullName
+ Java allClasses first name
+ Java allClasses first javaName
+ Java allClasses first javaPackage
+ Java allClasses first package
"
!
@@ -735,14 +652,14 @@
components := fullName asCollectionOfSubstringsSeparatedBy:$/.
components size > 1 ifTrue:[
- ^ (components copyWithoutLast:1) asStringWith:$.
+ ^ (components copyWithoutLast:1) asStringWith:$.
].
^ fullName
"
- Java allClasses first fullName
- Java allClasses first javaPackage
- Java allClasses first package
+ Java allClasses first fullName
+ Java allClasses first javaPackage
+ Java allClasses first package
"
!
@@ -783,7 +700,7 @@
i := fullName lastIndexOf:$/.
p := fullName copyTo:i - 1.
p size == 0 ifTrue:[
- ^ 'java'
+ ^ 'java'
].
"/ components := fullName asCollectionOfSubstringsSeparatedBy:$/.
"/ components size > 1 ifTrue:[
@@ -795,9 +712,9 @@
^ 'java:' , p
"
- Java allClasses first fullName
- Java allClasses first package
- Java allClasses first javaPackage
+ Java allClasses first fullName
+ Java allClasses first package
+ Java allClasses first javaPackage
"
!
@@ -831,7 +748,7 @@
self error:'no such field'
"
- (JAVA at:#'java/awt/image/ColorModel') typeOfField:'pixel_bits'
+ (JAVA at:#'java/awt/image/ColorModel') typeOfField:'pixel_bits'
"
"Modified: 21.1.1997 / 22:48:28 / cg"
@@ -851,14 +768,14 @@
"return true, if this is an application class,
which can be started via #open"
- "/ if I have a main() method, I am
+ "/ if I have a main() method, I am
(self compiledMethodAt:#'main([Ljava/lang/String;)V') notNil ifTrue:[
- ^ true
+ ^ true
].
(self isSubclassOf:(Java at:'java.applet.Applet')) ifTrue:[
- ^ true.
+ ^ true.
].
^ false
@@ -870,7 +787,7 @@
"/ if I have a main, call it ...
(self compiledMethodAt:#'main([Ljava/lang/String;)V') notNil ifTrue:[
- ^ self startMain
+ ^ self startMain
].
"/ otherwise, create a frame and wrap me;
@@ -897,7 +814,7 @@
!JavaClass methodsFor:'compiler interface'!
browserClass
- "return the browser to use for this class -
+ "return the browser to use for this class -
this can be redefined in special classes, to get different browsers"
"/ ^ JavaBrowser
@@ -907,7 +824,7 @@
!
compilerClass
- "return the compiler to use for this class -
+ "return the compiler to use for this class -
this can be redefined in special classes, to compile classes with
Lisp, Prolog, ASN1, Basic :-) or whatever syntax."
@@ -915,7 +832,7 @@
!
evaluatorClass
- "return the compiler to use for expression evaluation for this class -
+ "return the compiler to use for expression evaluation for this class -
this can be redefined in special classes, to evaluate expressions with
Lisp, Prolog, ASN1, Basic :-) or whatever syntax."
@@ -924,7 +841,7 @@
!
parserClass
- "return the parser to use for parsing this class -
+ "return the parser to use for parsing this class -
this can be redefined in special classes, to parse classes with
Lisp, Prolog, ASN1, Basic :-) or whatever syntax."
@@ -933,7 +850,7 @@
!
syntaxHighlighterClass
- "return the class to use for syntaxHighlighting (prettyPrinting) this class -
+ "return the class to use for syntaxHighlighting (prettyPrinting) this class -
this can be redefined in special classes, to highlight classes with
Lisp, Prolog, ASN1, Basic :-) or whatever syntax."
@@ -1009,9 +926,9 @@
me perform:#'start()V'.
self halt.
- f perform:#'add(Ljava/lang/String;Ljava/awt/Component;)Ljava/awt/Component;'
- with:(Java as_String:'Center')
- with:me.
+ f perform:#'add(Ljava/lang/String;Ljava/awt/Component;)Ljava/awt/Component;'
+ with:(Java as_String:'Center')
+ with:me.
self halt.
f perform:#'setSize(II)V' with:300 with:300.
self halt.
@@ -1051,9 +968,9 @@
me perform:#'start()V'.
self halt.
- f perform:#'add(Ljava/lang/String;Ljava/awt/Component;)Ljava/awt/Component;'
- with:(Java as_String:'Center')
- with:me.
+ f perform:#'add(Ljava/lang/String;Ljava/awt/Component;)Ljava/awt/Component;'
+ with:(Java as_String:'Center')
+ with:me.
self halt.
f perform:#'setSize(II)V' with:300 with:300.
self halt.
@@ -1078,15 +995,15 @@
p := Java javaProcessForMainOf:self argumentString:aCommandLineString.
p notNil ifTrue:[
- p resume.
- Object abortSignal handle:[:ex |
+ p resume.
+ Object abortSignal handle:[:ex |
p == JavaVM javaScreenUpdaterThread ifTrue:[self halt].
p == JavaVM javaEventQueueThread ifTrue:[self halt].
- p terminate.
- ex reject.
- ] do:[
- p waitUntilTerminated
- ].
+ p terminate.
+ ex reject.
+ ] do:[
+ p waitUntilTerminated
+ ].
]
"Modified: / 24.12.1999 / 02:35:04 / cg"
@@ -1119,7 +1036,7 @@
accessFlags := accessFlags bitOr:A_INITIALIZED.
superclass ~~ JavaObject ifTrue:[
- superclass classInit
+ superclass classInit
].
"/ "/ also, all referenced classes must be ...
"/ constantPool classReferencesDo:[:aClass |
@@ -1129,20 +1046,20 @@
m := self compiledMethodAt:#'<clinit>()V'.
m notNil ifTrue:[
"/ 'calling clinit() of ' print. self fullName printNL.
- [
- OrderOfClassInits notNil ifTrue:[
- OrderOfClassInits add:self.
- ].
+ [
+ OrderOfClassInits notNil ifTrue:[
+ OrderOfClassInits add:self.
+ ].
- m
- valueWithReceiver:self
- arguments:#()
- selector:#'<clinit>()V'
- search:self class
- sender:nil
- ] valueOnUnwindDo:[
- accessFlags := accessFlags bitXor:A_INITIALIZED.
- ]
+ m
+ valueWithReceiver:self
+ arguments:#()
+ selector:#'<clinit>()V'
+ search:self class
+ sender:nil
+ ] valueOnUnwindDo:[
+ accessFlags := accessFlags bitXor:A_INITIALIZED.
+ ]
] ifFalse:[
"/ self fullName print. ' has no clinit()' printNL.
].
@@ -1155,7 +1072,7 @@
(Java classNamed:'java.lang.System') classInit
(Java classNamed:'java/io/FileDescriptor') classInit
- (Java classNamed:'java.util.Properties') classInit
+ (Java classNamed:'java.util.Properties') classInit
"
"Modified: / 12.11.1998 / 15:41:11 / cg"
@@ -1178,7 +1095,7 @@
] ifFalse:[type == #float ifTrue:[
val := 0.0 asShortFloat
] ifFalse:[type == #double ifTrue:[
- val := 0.0
+ val := 0.0
] ifFalse:[type == #byte ifTrue:[
val := 0.
] ifFalse:[type == #char ifTrue:[
@@ -1237,16 +1154,16 @@
|newJavaObject sz "{ Class: SmallInteger }" |
(accessFlags bitAnd:A_ABSTRACT_OR_INTERFACE) ~~ 0 ifTrue:[
- JavaVM throwInstantiationExceptionFor:self.
- ^ nil
+ JavaVM throwInstantiationExceptionFor:self.
+ ^ nil
].
newJavaObject := super basicNew.
initValues notNil ifTrue:[
- sz := self instSize.
- 1 to:sz do:[:i |
- newJavaObject instVarAt:i put:(initValues at:i)
- ].
+ sz := self instSize.
+ 1 to:sz do:[:i |
+ newJavaObject instVarAt:i put:(initValues at:i)
+ ].
].
^ newJavaObject
@@ -1267,9 +1184,9 @@
|newJavaObject|
newJavaObject := self newCleared.
- newJavaObject
- perform:#'<init>(Ljava/lang/String;)V'
- with:(Java as_String:argString).
+ newJavaObject
+ perform:#'<init>(Ljava/lang/String;)V'
+ with:(Java as_String:argString).
^ newJavaObject
"
@@ -1314,44 +1231,44 @@
methods := JavaClass lookupMethods:sel numArgs:numArgs in:self static:true.
methods size == 1 ifTrue:[
- javaMethod := methods first.
- "/ there is only one - try that one.
+ javaMethod := methods first.
+ "/ there is only one - try that one.
] ifFalse:[
- methods size > 1 ifTrue:[
- "/ more than one - select the ones that could be used.
- methods := methods select:[:aMethod |
- |argSignature|
+ methods size > 1 ifTrue:[
+ "/ more than one - select the ones that could be used.
+ methods := methods select:[:aMethod |
+ |argSignature|
- argSignature := aMethod argSignature.
- (JavaClass canConvertArgsToJava:args asSpecifiedIn:argSignature)
- ].
- methods size == 1 ifTrue:[
- javaMethod := methods first.
- ]
- ]
+ argSignature := aMethod argSignature.
+ (JavaClass canConvertArgsToJava:args asSpecifiedIn:argSignature)
+ ].
+ methods size == 1 ifTrue:[
+ javaMethod := methods first.
+ ]
+ ]
].
javaMethod notNil ifTrue:[
- (ArgumentConversionErrorSignal catch:[
- args notNil ifTrue:[
- args := JavaClass
- convertArgsToJava:args
- asSpecifiedIn:(javaMethod argSignature)
- numArgs:numArgs.
- ].
- ]) ifFalse:[
- retVal := javaMethod
- valueWithReceiver:self "/ (javaMethod javaClass)
- arguments:args
- selector:(javaMethod selector)
- search:self "/ (javaMethod javaClass class)
- sender:nil.
- ^ JavaClass convertToSmalltalk:retVal type:(javaMethod returnType).
- ].
- ^ MessageNotUnderstoodSignal
- raiseRequestWith:aMessage
- errorString:'no method for given argument(s)'
- in:thisContext "sender"
+ (ArgumentConversionErrorSignal catch:[
+ args notNil ifTrue:[
+ args := JavaClass
+ convertArgsToJava:args
+ asSpecifiedIn:(javaMethod argSignature)
+ numArgs:numArgs.
+ ].
+ ]) ifFalse:[
+ retVal := javaMethod
+ valueWithReceiver:self "/ (javaMethod javaClass)
+ arguments:args
+ selector:(javaMethod selector)
+ search:self "/ (javaMethod javaClass class)
+ sender:nil.
+ ^ JavaClass convertToSmalltalk:retVal type:(javaMethod returnType).
+ ].
+ ^ MessageNotUnderstoodSignal
+ raiseRequestWith:aMessage
+ errorString:'no method for given argument(s)'
+ in:thisContext "sender"
].
anyMethodsFound := false.
@@ -1360,40 +1277,40 @@
methods := JavaClass lookupMethods:sel numArgs:nil in:self static:true.
methods size > 0 ifTrue:[
- anyMethodsFound := true.
- numArgs > 0 ifTrue:[
- methods do:[:methodToTry |
- (ArgumentConversionErrorSignal catch:[
- newArgs := JavaClass
- convertArgsToJava:args
- asSpecifiedIn:(methodToTry argSignature)
- numArgs:methodToTry numArgs.
- ]) ifFalse:[
- retVal := methodToTry
- valueWithReceiver:self "/ (methodToTry javaClass)
- arguments:newArgs
- selector:(methodToTry selector)
- search:self "/ (methodToTry javaClass class)
- sender:nil.
- ^ JavaClass convertToSmalltalk:retVal type:(methodToTry returnType).
- ].
- ].
- ]
+ anyMethodsFound := true.
+ numArgs > 0 ifTrue:[
+ methods do:[:methodToTry |
+ (ArgumentConversionErrorSignal catch:[
+ newArgs := JavaClass
+ convertArgsToJava:args
+ asSpecifiedIn:(methodToTry argSignature)
+ numArgs:methodToTry numArgs.
+ ]) ifFalse:[
+ retVal := methodToTry
+ valueWithReceiver:self "/ (methodToTry javaClass)
+ arguments:newArgs
+ selector:(methodToTry selector)
+ search:self "/ (methodToTry javaClass class)
+ sender:nil.
+ ^ JavaClass convertToSmalltalk:retVal type:(methodToTry returnType).
+ ].
+ ].
+ ]
].
anyMethodsFound ifTrue:[
- methods size == 1 ifTrue:[
- javaMethod := methods first.
+ methods size == 1 ifTrue:[
+ javaMethod := methods first.
- ^ MessageNotUnderstoodSignal
- raiseRequestWith:aMessage
- errorString:(sel , ' expects ' , javaMethod argSignature size printString , ' argument(s)')
- in:thisContext "sender"
- ].
- ^ MessageNotUnderstoodSignal
- raiseRequestWith:aMessage
- errorString:'no method for given argument count or type'
- in:thisContext "sender"
+ ^ MessageNotUnderstoodSignal
+ raiseRequestWith:aMessage
+ errorString:(sel , ' expects ' , javaMethod argSignature size printString , ' argument(s)')
+ in:thisContext "sender"
+ ].
+ ^ MessageNotUnderstoodSignal
+ raiseRequestWith:aMessage
+ errorString:'no method for given argument count or type'
+ in:thisContext "sender"
].
^ super doesNotUnderstand:aMessage
@@ -1423,14 +1340,14 @@
sel := selector asSymbolIfInterned.
sel notNil ifTrue:[
- javaMethod := methodDictionary at:sel.
- javaMethod notNil ifTrue:[
- javaMethod isStatic ifTrue:[
- ^ javaMethod
- valueWithReceiver:self
- arguments:#()
- ]
- ].
+ javaMethod := methodDictionary at:sel.
+ javaMethod notNil ifTrue:[
+ javaMethod isStatic ifTrue:[
+ ^ javaMethod
+ valueWithReceiver:self
+ arguments:#()
+ ]
+ ].
].
^ self doesNotUnderstand:(Message selector:selector)
@@ -1446,17 +1363,17 @@
sel := selector asSymbolIfInterned.
sel notNil ifTrue:[
- javaMethod := methodDictionary at:sel.
- javaMethod notNil ifTrue:[
- javaMethod isStatic ifTrue:[
- ^ javaMethod
- valueWithReceiver:self
- arguments:(Array with:arg)
- selector:selector
- search:nil
- sender:nil
- ]
- ].
+ javaMethod := methodDictionary at:sel.
+ javaMethod notNil ifTrue:[
+ javaMethod isStatic ifTrue:[
+ ^ javaMethod
+ valueWithReceiver:self
+ arguments:(Array with:arg)
+ selector:selector
+ search:nil
+ sender:nil
+ ]
+ ].
].
^ self doesNotUnderstand:(Message selector:selector argument:arg)
@@ -1535,18 +1452,6 @@
"Created: 20.1.1997 / 13:00:48 / cg"
!
-makeObsolete
- accessFlags := accessFlags bitOr:A_OBSOLETE
-
- "Created: 7.8.1997 / 19:04:48 / cg"
-!
-
-markUninitialized
- (accessFlags bitAnd:A_INITIALIZED) ~~ 0 ifTrue:[
- accessFlags := accessFlags bitXor:A_INITIALIZED
- ].
-!
-
setAccessFlags:flags
accessFlags := flags.
@@ -1571,18 +1476,18 @@
instSize := superclass instSize + f size.
fields := f.
- vals := self allInstVarNames
- collect:[:nm |
- self initValueFor:nm
- ].
+ vals := self allInstVarNames
+ collect:[:nm |
+ self initValueFor:nm
+ ].
vals isEmpty ifTrue:[
- initValues := nil
+ initValues := nil
] ifFalse:[
- (vals detect:[:el | el notNil] ifNone:nil) isNil ifTrue:[
- initValues := nil
- ] ifFalse:[
- initValues := vals asArray
- ]
+ (vals detect:[:el | el notNil] ifNone:nil) isNil ifTrue:[
+ initValues := nil
+ ] ifFalse:[
+ initValues := vals asArray
+ ]
]
"Created: / 15.4.1996 / 16:42:52 / cg"
@@ -1667,14 +1572,14 @@
required by the argument, an aJavaInterface"
interfaces size > 0 ifTrue:[
- self interfaces do:[:if |
- aJavaInterface == if ifTrue:[
- ^ true
- ].
- ]
+ self interfaces do:[:if |
+ aJavaInterface == if ifTrue:[
+ ^ true
+ ].
+ ]
].
superclass isJavaClass ifTrue:[
- ^ superclass hasInterface:aJavaInterface
+ ^ superclass hasInterface:aJavaInterface
].
^ false.
@@ -1689,40 +1594,6 @@
!
-isAbstract
- "return true, if the receiver is abstract
- (i.e. may not have instances)"
-
- ^ (accessFlags bitAnd:A_ABSTRACT) ~~ 0
-
- "Modified: / 7.5.1998 / 12:24:42 / cg"
-!
-
-isFinal
- "return true, if the receiver is final
- (i.e. may not be subclassed)"
-
- ^ (accessFlags bitAnd:A_FINAL) ~~ 0
-
- "Modified: / 7.5.1998 / 12:24:21 / cg"
-!
-
-isInitialized
- "return true, if the receiver is initialized"
-
- ^ (accessFlags bitAnd:A_INITIALIZED) ~~ 0
-
- "Modified: / 7.5.1998 / 12:23:54 / cg"
-!
-
-isInterface
- "return true, if the receiver is an interface"
-
- ^ (accessFlags bitAnd:A_INTERFACE) ~~ 0
-
- "Modified: / 7.5.1998 / 12:23:39 / cg"
-!
-
isJavaClass
^ self ~~ JavaClass
@@ -1735,26 +1606,9 @@
"Created: / 9.11.1999 / 15:42:10 / cg"
!
-isObsolete
- "return true, if the receiver is obsolete
- Java classes are never."
-
- ^ (accessFlags bitAnd:A_OBSOLETE) ~~ 0.
-
- "Modified: 7.8.1997 / 19:04:28 / cg"
-!
-
-isPublic
- "return true, if the receiver is public"
-
- ^ (accessFlags bitAnd:A_PUBLIC) ~~ 0
-
- "Modified: / 7.5.1998 / 12:22:44 / cg"
-!
-
isUnresolved
"return true, if the receiver is unresolved;
- javaClasses are never; JavaUnresolvedClasses are always"
+ javaClasses are never; JavaUnresolvedClasses are always"
^ false
@@ -1774,15 +1628,15 @@
s := '' writeStream.
s nextPutAll:'JAVA'.
parts from:1 to:(parts size - 1) do:[:aPart |
- s nextPutAll:'::'.
- s nextPutAll:aPart
+ s nextPutAll:'::'.
+ s nextPutAll:aPart
].
^ s contents
"
- JAVA::java::lang::Object fullName
- JAVA::java::lang::Object nameSpacePath
- JAVA::java::lang::Object name
+ JAVA::java::lang::Object fullName
+ JAVA::java::lang::Object nameSpacePath
+ JAVA::java::lang::Object name
"
"Modified: / 19.10.1998 / 20:07:24 / cg"
@@ -1799,7 +1653,7 @@
^ 'L' , self fullName
"
- (Java at:'java.util.Stack') typeName
+ (Java at:'java.util.Stack') typeName
"
"Modified: / 10.2.1998 / 17:13:26 / cg"
@@ -1809,7 +1663,7 @@
arrayClass
"/ self halt.
- ^ Array
+ ^ Array
"Created: / 10.11.1998 / 02:07:32 / cg"
"Modified: / 8.1.1999 / 14:11:34 / cg"
@@ -1824,30 +1678,30 @@
!
deref
- ^ self
+ ^ self
"Created: / 10.11.1998 / 02:08:06 / cg"
!
updateClassRefsFrom:oldClass to:newClass
self == oldClass ifTrue:[
- self makeObsolete.
- ^ self
+ self makeObsolete.
+ ^ self
].
constantPool updateClassRefsFrom:oldClass to:newClass.
interfaces notNil ifTrue:[
- interfaces := interfaces collect:[:anInterface |
- anInterface == oldClass ifTrue:[
- newClass isNil ifTrue:[
- nil "/ replace by an unresolvedInterface
- ] ifFalse:[
- newClass
- ]
- ] ifFalse:[
- anInterface
- ]
- ]
+ interfaces := interfaces collect:[:anInterface |
+ anInterface == oldClass ifTrue:[
+ newClass isNil ifTrue:[
+ nil "/ replace by an unresolvedInterface
+ ] ifFalse:[
+ newClass
+ ]
+ ] ifFalse:[
+ anInterface
+ ]
+ ]
]
"Modified: / 4.2.1998 / 22:08:19 / cg"
@@ -1856,7 +1710,7 @@
!JavaClass class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libjava/JavaClass.st,v 1.124 2002-11-22 20:09:17 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libjava/JavaClass.st,v 1.125 2005-08-12 16:31:06 cg Exp $'
! !
JavaClass initialize!