diff truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/source/Source.java @ 22430:1c39c96a1703

remove support for auto-reloading of files from disk
author Christian Wirth <christian.wirth@oracle.com>
date Thu, 03 Dec 2015 14:40:52 +0100
parents 7015a77b222f
children 07f3efb4e321
line wrap: on
line diff
--- a/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/source/Source.java	Thu Dec 03 09:14:20 2015 +0100
+++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/source/Source.java	Thu Dec 03 14:40:52 2015 +0100
@@ -54,7 +54,6 @@
 
 import com.oracle.truffle.api.CompilerAsserts;
 import com.oracle.truffle.api.TruffleLanguage.Registration;
-import com.oracle.truffle.api.TruffleOptions;
 
 /**
  * Representation of a guest language source code unit and its contents. Sources originate in
@@ -834,12 +833,6 @@
 
         private String code = null;  // A cache of the file's contents
 
-        /**
-         * Timestamp of the cache in the file system. Enabled by setting
-         * {@link TruffleOptions.AutoReloadFileSource} to true.
-         */
-        private long timeStamp;
-
         public FileSource(File file, String name, String path) {
             this.file = file.getAbsoluteFile();
             this.name = name;
@@ -864,12 +857,9 @@
         @Override
         public String getCode() {
             if (fileCacheEnabled) {
-                if (code == null || (TruffleOptions.AutoReloadFileSource && timeStamp != file.lastModified())) {
+                if (code == null) {
                     try {
                         code = read(getReader());
-                        if (TruffleOptions.AutoReloadFileSource) {
-                            timeStamp = file.lastModified();
-                        }
                     } catch (IOException e) {
                     }
                 }
@@ -894,7 +884,7 @@
 
         @Override
         public Reader getReader() {
-            if (code != null && (TruffleOptions.AutoReloadFileSource && timeStamp == file.lastModified())) {
+            if (code != null) {
                 return new StringReader(code);
             }
             try {