Repository: systemml
Updated Branches:
  refs/heads/master ba497ba4f -> c7a9e016d


[SYSTEMML-2347] Fix inconsistent namespace names (OS-specific paths)

This patch fixes issues with OS-specific file paths used as physical
namespace names, which created problems for second order functions such
as eval and paramserv which potentially load functions by name.

Project: http://git-wip-us.apache.org/repos/asf/systemml/repo
Commit: http://git-wip-us.apache.org/repos/asf/systemml/commit/c7a9e016
Tree: http://git-wip-us.apache.org/repos/asf/systemml/tree/c7a9e016
Diff: http://git-wip-us.apache.org/repos/asf/systemml/diff/c7a9e016

Branch: refs/heads/master
Commit: c7a9e016d120c93a5a947133a4511dde456ec7c4
Parents: ba497ba
Author: Matthias Boehm <[email protected]>
Authored: Mon May 28 20:11:39 2018 -0700
Committer: Matthias Boehm <[email protected]>
Committed: Mon May 28 20:12:10 2018 -0700

----------------------------------------------------------------------
 .../apache/sysml/parser/common/CommonSyntacticValidator.java   | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/systemml/blob/c7a9e016/src/main/java/org/apache/sysml/parser/common/CommonSyntacticValidator.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/sysml/parser/common/CommonSyntacticValidator.java 
b/src/main/java/org/apache/sysml/parser/common/CommonSyntacticValidator.java
index ab9c330..48863be 100644
--- a/src/main/java/org/apache/sysml/parser/common/CommonSyntacticValidator.java
+++ b/src/main/java/org/apache/sysml/parser/common/CommonSyntacticValidator.java
@@ -176,8 +176,10 @@ public abstract class CommonSyntacticValidator {
        }
        
        private static String getWorkingFilePath(String filePath, String 
workingDir) {
-               return !new File(filePath).isAbsolute() ?
-                       workingDir + File.separator + filePath : filePath;
+               //NOTE: the use of File.separator would lead to OS-specific 
inconsistencies,
+               //which is problematic for second order functions such as eval 
or paramserv.
+               //Since this is unnecessary, we now use "/" independent of the 
use OS.
+               return !new File(filePath).isAbsolute() ? workingDir + "/" + 
filePath : filePath;
        }
        
        public String getNamespaceSafe(Token ns) {

Reply via email to