Fixes in Java source highlighting - boot Java if not already. development
authorJan Vrany <jan.vrany@fit.cvut.cz>
Tue, 26 Nov 2013 23:04:56 +0000
branchdevelopment
changeset 2950 ec1be126d72e
parent 2949 448a12efa893
child 2951 590fd4bf22a8
Fixes in Java source highlighting - boot Java if not already.
tools/JavaSourceDocument.st
tools/JavaSourceHighlighter.st
--- a/tools/JavaSourceDocument.st	Tue Nov 26 21:21:13 2013 +0000
+++ b/tools/JavaSourceDocument.st	Tue Nov 26 23:04:56 2013 +0000
@@ -302,6 +302,7 @@
 
             source := javaClass theNonMetaclass source.
             source notNil ifTrue: [
+                JavaVM booted ifFalse:[JavaVM boot].
                 unit := (Java classForName: 'stx.libjava.tools.Source') new.
                 unit setContents: source.
                 JavaCompiler synchronized:[
@@ -321,7 +322,7 @@
     task resume.
 
     "Created: / 06-09-2013 / 17:50:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 08-10-2013 / 22:47:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 26-11-2013 / 23:04:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !JavaSourceDocument methodsFor:'printing & storing'!
--- a/tools/JavaSourceHighlighter.st	Tue Nov 26 21:21:13 2013 +0000
+++ b/tools/JavaSourceHighlighter.st	Tue Nov 26 23:04:56 2013 +0000
@@ -250,6 +250,7 @@
     self doLexicalHighlightingOnly ifTrue:[          
         sourceText := self format: source string.
     ] ifFalse:[
+        JavaVM booted ifFalse:[JavaVM boot].
         sourceUnit := (Java classForName:'stx.libjava.tools.Source') new.
         sourceUnit setContents: source string.
         JavaCompiler synchronized:[
@@ -279,7 +280,7 @@
     ]
 
     "Created: / 04-08-2011 / 23:44:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 20-10-2013 / 00:06:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 26-11-2013 / 22:54:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 formatClassDefinition:source in:class elementsInto: els
@@ -322,6 +323,7 @@
     ] ifFalse:[
         | document type parser marker nodes debug |
 
+        JavaVM booted ifFalse:[JavaVM boot].
         document := JavaSourceDocument cachedDocumentFor: class theNonMetaclass.
         document isNil ifTrue:[
             document := JavaSourceDocument for: class theNonMetaclass.
@@ -347,7 +349,7 @@
     ^ sourceText
 
     "Created: / 04-08-2011 / 23:45:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified (format): / 03-10-2013 / 20:20:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (format): / 26-11-2013 / 23:04:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 formatMethod:mth source:source in:class using: prefs elementsInto: els