Fix in JavaCompiler: refetch classes after registering them. development
authorJan Vrany <jan.vrany@fit.cvut.cz>
Mon, 05 Aug 2013 10:49:25 +0100
branchdevelopment
changeset 2643 dc73ff5b258a
parent 2642 fad6365a2e15
child 2644 e61250315ca8
Fix in JavaCompiler: refetch classes after registering them. When class is registered in class registry, possbilt pre-existing class can be only updated. Thus refetch classes before returning from compile: method to return the true set of classes which are registred.
experiments/JavaCompiler.st
experiments/Makefile.init
experiments/experiments.rc
--- a/experiments/JavaCompiler.st	Mon Aug 05 10:45:36 2013 +0100
+++ b/experiments/JavaCompiler.st	Mon Aug 05 10:49:25 2013 +0100
@@ -192,11 +192,16 @@
                 requestor: requestor;
                 compile: source.
     register ifTrue:[
-        JavaVM registry registerClasses: classes.
+        JavaVM registry registerClasses: classes andWait: true.
+        "/ Register class may eventually reload a class. When only methods are changed,
+        "/ reloader only updates method dictionary and constant pools and the new class
+        "/ is immediately thrown away. Thus, refetch classes...
+        classes := classes collect:[:cls|JavaVM registry classNamed: cls name loader: cls classLoader].
     ].
     ^classes first.
 
     "Created: / 03-04-2013 / 00:10:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 04-08-2013 / 14:10:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 evaluate: source notifying: requestor compile: doCompile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/experiments/Makefile.init	Mon Aug 05 10:49:25 2013 +0100
@@ -0,0 +1,27 @@
+#
+# DO NOT EDIT
+#
+# make uses this file (Makefile) only, if there is no
+# file named "makefile" (lower-case m) in the same directory.
+# My only task is to generate the real makefile and call make again.
+# Thereafter, I am no longer used and needed.
+#
+# MACOSX caveat:
+#   as filenames are not case sensitive (in a default setup),
+#   we cannot use the above trick. Therefore, this file is now named
+#   "Makefile.init", and you have to execute "make -f Makefile.init" to
+#   get the initial makefile.  This is now also done by the toplevel CONFIG
+#   script.
+
+.PHONY: run
+
+run: makefile
+	$(MAKE) -f makefile
+
+#only needed for the definition of $(TOP)
+include Make.proto
+
+makefile: mf
+
+mf:
+	$(TOP)/rules/stmkmf
--- a/experiments/experiments.rc	Mon Aug 05 10:45:36 2013 +0100
+++ b/experiments/experiments.rc	Mon Aug 05 10:49:25 2013 +0100
@@ -3,7 +3,7 @@
 // automagically generated from the projectDefinition: stx_libjava_experiments.
 //
 VS_VERSION_INFO VERSIONINFO
-  FILEVERSION     6,2,9206,9206
+  FILEVERSION     6,2,32767,32767
   PRODUCTVERSION  6,2,3,0
 #if (__BORLANDC__)
   FILEFLAGSMASK   VS_FF_DEBUG | VS_FF_PRERELEASE
@@ -20,12 +20,12 @@
     BEGIN
       VALUE "CompanyName", "eXept Software AG\0"
       VALUE "FileDescription", "Smalltalk/X Class library (LIB)\0"
-      VALUE "FileVersion", "6.2.9206.9206\0"
+      VALUE "FileVersion", "6.2.32767.32767\0"
       VALUE "InternalName", "stx:libjava/experiments\0"
       VALUE "LegalCopyright", "Copyright Claus Gittinger 1988-2013\nCopyright eXept Software AG 1998-2013\0"
       VALUE "ProductName", "Smalltalk/X\0"
       VALUE "ProductVersion", "6.2.3.0\0"
-      VALUE "ProductDate", "Tue, 07 May 2013 11:34:52 GMT\0"
+      VALUE "ProductDate", "Mon, 05 Aug 2013 09:45:41 GMT\0"
     END
 
   END