Java Workspace now share same binding (i.e., workspace variables are remembered) jk_new_structure
authorvranyj1
Mon, 24 Oct 2011 14:12:56 +0000
branchjk_new_structure
changeset 1044 84b7d94d9eb8
parent 1043 924a3f56564c
child 1045 6b11c34520f2
Java Workspace now share same binding (i.e., workspace variables are remembered)
src/JavaEvaluator.st
--- a/src/JavaEvaluator.st	Mon Oct 24 09:39:27 2011 +0000
+++ b/src/JavaEvaluator.st	Mon Oct 24 14:12:56 2011 +0000
@@ -42,8 +42,8 @@
 "{ Package: 'stx:libjava' }"
 
 Object subclass:#JavaEvaluator
-	instanceVariableNames:'WorkspaceBinding'
-	classVariableNames:''
+	instanceVariableNames:''
+	classVariableNames:'WorkspaceBinding'
 	poolDictionaries:''
 	category:'Languages-Java-Support'
 !
@@ -111,15 +111,15 @@
         Java initialize.
         JavaVM initializeVM.
     ].
-    (requestor notNil 
-        and: [ requestor application isKindOf: WorkspaceApplication ]) 
-            ifTrue: [
-                WorkspaceBinding isNil ifTrue: [
-                    WorkspaceBinding := (JavaVM classForName: 'groovy.lang.Binding') new.
-                ].
-                binding := WorkspaceBinding
-            ]
-            ifFalse: [ binding := (Java classForName: 'groovy.lang.Binding') new. ].
+    (requestor notNil and: [ requestor application isKindOf: WorkspaceApplication ]) ifTrue: [
+        WorkspaceBinding isNil ifTrue: [
+            WorkspaceBinding := (JavaVM classForName: 'groovy.lang.Binding') new.
+        ].
+        binding := WorkspaceBinding
+    ] ifFalse: [ 
+        binding := (Java classForName: 'groovy.lang.Binding') new. 
+    ].
+
     shell := (Java classForName: 'groovy.lang.GroovyShell') newCleared.
     shell perform: #'<init>(Lgroovy/lang/Binding;)V' with: binding.
     result := shell perform: #'evaluate(Ljava/lang/String;)Ljava/lang/Object;'