Fix for D116331: Do not write to a changefile when compiling new native method
authorJan Vrany <jan.vrany@fit.cvut.cz>
Tue, 06 Jan 2015 11:01:47 +0100
changeset 3325 d9297d724fa0
parent 3324 a58245c0e83a
child 3326 a373d416ae8c
Fix for D116331: Do not write to a changefile when compiling new native method Otherwise compilation will fail if changes file is not writabe. However, add a record to internal in-memory changeset so browser marks it correctly as changed/new method. Fixes D116331.
JavaNativeMethod.st
--- a/JavaNativeMethod.st	Mon Jan 05 17:10:02 2015 +0100
+++ b/JavaNativeMethod.st	Tue Jan 06 11:01:47 2015 +0100
@@ -20,6 +20,8 @@
 "
 "{ Package: 'stx:libjava' }"
 
+"{ NameSpace: Smalltalk }"
+
 JavaMethodWithHandler variableSubclass:#JavaNativeMethod
 	instanceVariableNames:'nativeImplementation nCalls'
 	classVariableNames:'CacheNativeImplementation Verbose TrampolineSelectors'
@@ -295,17 +297,18 @@
 
     ].
 
-    (JavaVM natives class 
-        compile:
-            (self nativeMethodTemplate bindWith:header with: 'nativeContext' with:('^ JavaVM unimplementedNativeMethodSignal raise'))
-        classified:         
-            'native - ', ((javaClass javaPackage upTo:$$) replaceAll:$/ with:$.))
-        package: JavaVM package.
-
+    Class updateChangeFileQuerySignal answer: false do:[
+        (JavaVM natives class 
+            compile:
+                (self nativeMethodTemplate bindWith:header with: 'nativeContext' with:('^ JavaVM unimplementedNativeMethodSignal raise'))
+            classified:         
+                'native - ', ((javaClass javaPackage upTo:$$) replaceAll:$/ with:$.))
+            package: JavaVM package.
+    ].
     self assert: (JavaVM natives respondsTo: sel).
 
     "Created: / 01-05-2011 / 00:08:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 04-03-2013 / 17:31:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-01-2015 / 09:14:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 nativeMethodTemplate