STC bug workaround in JavaMethod>>source. development
authorJan Vrany <jan.vrany@fit.cvut.cz>
Wed, 11 Sep 2013 03:01:48 +0100
branchdevelopment
changeset 2725 258b8c6de530
parent 2724 0f4edfee344b
child 2726 6971720de5a4
STC bug workaround in JavaMethod>>source.
JavaMethod.st
--- a/JavaMethod.st	Wed Sep 11 02:36:57 2013 +0100
+++ b/JavaMethod.st	Wed Sep 11 03:01:48 2013 +0100
@@ -1293,29 +1293,28 @@
         ^ self decompiledBytecode
     ].
 
-    source notNil ifTrue:[
-        ^ source readFrom: javaClass source.
-    ].
-
     sourceString := javaClass source.
     sourceString isNil ifTrue:[
         ^ self decompiledSource.
     ].
 
+
+    source notNil ifTrue:[
+        ^ source readFrom: sourceString.
+    ].
+
+
     "/ stx:libjava/tools may not be loaded...    
-    ^  JavaSourceDocument notNil ifTrue:[
+    JavaSourceDocument notNil ifTrue:[
         "/ As a side effect, this fills in source references for all methods.
         "/ see JavaSourceDocument
         | document |
 
         ((document := self sourceDocument) notNil and:[document sourceTree notNil]) ifTrue:[
-            source readFrom: javaClass source.
-        ] ifFalse:[
-            sourceString
+            ^ source readFrom: sourceString.
         ]
-    ] ifFalse:[
-        sourceString
-    ]
+    ].
+    ^ sourceString
 
     "Modified: / 04-01-1998 / 13:48:35 / cg"
     "Modified: / 13-12-2010 / 11:06:51 / Jan Kurs <kurs.jan@post.cz>"