--- a/Java.st Mon Mar 09 18:39:29 1998 +0000
+++ b/Java.st Mon Mar 30 15:26:47 1998 +0000
@@ -820,7 +820,6 @@
aClass isNil ifTrue:[
^ nil
].
- package := aClass package.
"/ first, look in the directory, where the binary
"/ was loaded from.
@@ -828,7 +827,15 @@
binary := aClass binaryFile.
binary notNil ifTrue:[
binary := binary asFilename.
- sourceFileName := binary withSuffix:'java'.
+ aClass sourceFile notNil ifTrue:[
+ sourceFileName := binary directory constructString:(aClass sourceFile).
+ sourceFileName asFilename exists ifFalse:[
+ sourceFileName := nil.
+ ]
+ ].
+ sourceFileName isNil ifTrue:[
+ sourceFileName := binary withSuffix:'java'.
+ ].
sourceFile := sourceFileName asFilename.
] ifFalse:[
"/ maybe it was loaded by a java classLoader ...
@@ -848,7 +855,6 @@
]
]
].
-
sourceFile notNil ifTrue:[
sourceFile exists ifFalse:[
binary notNil ifTrue:[
@@ -880,6 +886,8 @@
"/ if that fails, look in standard places
(sourceFile isNil or:[sourceFile exists not]) ifTrue:[
+ package := aClass package.
+
sourceFileName := aClass sourceFile.
sourceFile := sourceFileName asFilename.
sourceFile exists ifFalse:[
@@ -920,25 +928,27 @@
].
^ (sourceFile contentsOfEntireFile).
- "Modified: / 23.1.1998 / 17:50:06 / cg"
+ "Modified: / 29.3.1998 / 11:55:46 / cg"
!
findSourceDirOf:fileName inPackage:aPackage
SourceDirectories notNil ifTrue:[
- SourceDirectories do:[:aDir |
- (aDir asFilename construct:('/' , aPackage , '/' , fileName))
- asFilename exists ifTrue:[
- ^ aDir
- ].
- (aDir asFilename construct:('/' , fileName))
- asFilename exists ifTrue:[
- ^ aDir
- ].
- ]
+ SourceDirectories do:[:aDir |
+ aPackage notNil ifTrue:[
+ (aDir asFilename construct:('/' , aPackage , '/' , fileName))
+ asFilename exists ifTrue:[
+ ^ aDir
+ ].
+ ].
+ (aDir asFilename construct:('/' , fileName))
+ asFilename exists ifTrue:[
+ ^ aDir
+ ].
+ ]
].
^ nil
-
+ "Modified: / 29.3.1998 / 21:46:40 / cg"
! !
!Java class methodsFor:'starting apps'!
@@ -1041,6 +1051,6 @@
!Java class methodsFor:'documentation'!
version
- ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/Java.st,v 1.61 1998/02/06 01:56:01 cg Exp $'
+ ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/Java.st,v 1.62 1998/03/30 15:26:47 cg Exp $'
! !
Java initialize!