You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemml.apache.org by de...@apache.org on 2016/05/31 18:51:42 UTC

incubator-systemml git commit: [SYSTEMML-626] Source statement resolves absolute paths

Repository: incubator-systemml
Updated Branches:
  refs/heads/master b14d55bed -> b18b854b8


[SYSTEMML-626] Source statement resolves absolute paths

Fix source statement to deal with absolute paths.

Closes #168.


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

Branch: refs/heads/master
Commit: b18b854b870c242effc732a0b45923adb26ef099
Parents: b14d55b
Author: Tatsuya.Nishiyama <ni...@gmail.com>
Authored: Tue May 31 11:48:55 2016 -0700
Committer: Deron Eriksson <de...@us.ibm.com>
Committed: Tue May 31 11:48:55 2016 -0700

----------------------------------------------------------------------
 .../org/apache/sysml/parser/dml/DmlSyntacticValidator.java   | 8 ++++++--
 .../apache/sysml/parser/pydml/PydmlSyntacticValidator.java   | 7 +++++--
 2 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/b18b854b/src/main/java/org/apache/sysml/parser/dml/DmlSyntacticValidator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/parser/dml/DmlSyntacticValidator.java b/src/main/java/org/apache/sysml/parser/dml/DmlSyntacticValidator.java
index 321ba7a..ca8728e 100644
--- a/src/main/java/org/apache/sysml/parser/dml/DmlSyntacticValidator.java
+++ b/src/main/java/org/apache/sysml/parser/dml/DmlSyntacticValidator.java
@@ -390,8 +390,12 @@ public class DmlSyntacticValidator extends CommonSyntacticValidator implements D
 			filePath = filePath.substring(1, filePath.length()-1);
 		}
 
-		//concatenate working directory to filepath
-		filePath = _workingDir + File.separator + filePath;
+		File file = new File(filePath);
+		if (!file.isAbsolute()) {
+			//concatenate working directory to filepath
+			filePath = _workingDir + File.separator + filePath;
+		}
+
 		validateNamespace(namespace, filePath, ctx);
 		String scriptID = DMLProgram.constructFunctionKey(namespace, filePath);
 

http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/b18b854b/src/main/java/org/apache/sysml/parser/pydml/PydmlSyntacticValidator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/parser/pydml/PydmlSyntacticValidator.java b/src/main/java/org/apache/sysml/parser/pydml/PydmlSyntacticValidator.java
index b4803ee..a8dfe70 100644
--- a/src/main/java/org/apache/sysml/parser/pydml/PydmlSyntacticValidator.java
+++ b/src/main/java/org/apache/sysml/parser/pydml/PydmlSyntacticValidator.java
@@ -507,8 +507,11 @@ public class PydmlSyntacticValidator extends CommonSyntacticValidator implements
 			filePath = filePath.substring(1, filePath.length()-1);
 		}
 
-		//concatenate working directory to filepath
-		filePath = _workingDir + File.separator + filePath;
+		File file = new File(filePath);
+		if (!file.isAbsolute()) {
+			//concatenate working directory to filepath
+			filePath = _workingDir + File.separator + filePath;
+		}
 		validateNamespace(namespace, filePath, ctx);
 		String scriptID = DMLProgram.constructFunctionKey(namespace, filePath);