Repository: incubator-systemml Updated Branches: refs/heads/master 0a4d563e4 -> 468a366bd
Update parse method parameters from HashMap to Map Referencing Map interface rather than HashMap concrete class allows the methods to not be tied to a specific implementation of Map. Closes #124. Project: http://git-wip-us.apache.org/repos/asf/incubator-systemml/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-systemml/commit/468a366b Tree: http://git-wip-us.apache.org/repos/asf/incubator-systemml/tree/468a366b Diff: http://git-wip-us.apache.org/repos/asf/incubator-systemml/diff/468a366b Branch: refs/heads/master Commit: 468a366bdc55b95ddd7095e4a3e4e4cd565ea81c Parents: 0a4d563 Author: Deron Eriksson <de...@us.ibm.com> Authored: Fri Apr 22 10:07:49 2016 -0700 Committer: Deron Eriksson <de...@us.ibm.com> Committed: Fri Apr 22 10:07:49 2016 -0700 ---------------------------------------------------------------------- .../java/org/apache/sysml/api/DMLScript.java | 13 ++++---- .../java/org/apache/sysml/api/MLContext.java | 33 ++++++++++---------- .../java/org/apache/sysml/api/MLOutput.java | 14 ++++----- .../org/apache/sysml/api/jmlc/Connection.java | 11 ++++--- .../org/apache/sysml/parser/AParserWrapper.java | 4 +-- .../parser/common/CommonSyntacticValidator.java | 5 ++- .../sysml/parser/dml/DMLParserWrapper.java | 5 ++- .../sysml/parser/dml/DmlSyntacticValidator.java | 3 +- .../sysml/parser/pydml/PyDMLParserWrapper.java | 5 ++- .../parser/pydml/PydmlSyntacticValidator.java | 3 +- 10 files changed, 49 insertions(+), 47 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/468a366b/src/main/java/org/apache/sysml/api/DMLScript.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/api/DMLScript.java b/src/main/java/org/apache/sysml/api/DMLScript.java index ce58974..aa45eb9 100644 --- a/src/main/java/org/apache/sysml/api/DMLScript.java +++ b/src/main/java/org/apache/sysml/api/DMLScript.java @@ -32,6 +32,7 @@ import java.util.Collections; import java.util.Date; import java.util.HashMap; import java.util.HashSet; +import java.util.Map; import java.util.Scanner; import org.apache.commons.logging.Log; @@ -322,7 +323,7 @@ public class DMLScript //Step 2: prepare script invocation String dmlScriptStr = readDMLScript(args[0], args[1]); - HashMap<String, String> argVals = createArgumentsMap(namedScriptArgs, scriptArgs); + Map<String, String> argVals = createArgumentsMap(namedScriptArgs, scriptArgs); DML_FILE_PATH_ANTLR_PARSER = args[1]; @@ -369,10 +370,10 @@ public class DMLScript * @param args * @throws LanguageException */ - protected static HashMap<String,String> createArgumentsMap(boolean hasNamedArgs, String[] args) + protected static Map<String,String> createArgumentsMap(boolean hasNamedArgs, String[] args) throws LanguageException { - HashMap<String, String> argMap = new HashMap<String,String>(); + Map<String, String> argMap = new HashMap<String,String>(); if (args == null) return argMap; @@ -562,7 +563,7 @@ public class DMLScript * @throws LanguageException * @throws LopsException */ - private static void execute(String dmlScriptStr, String fnameOptConfig, HashMap<String,String> argVals, String[] allArgs, boolean parsePyDML) + private static void execute(String dmlScriptStr, String fnameOptConfig, Map<String,String> argVals, String[] allArgs, boolean parsePyDML) throws ParseException, IOException, DMLRuntimeException, LanguageException, HopsException, LopsException { //print basic time and environment info @@ -707,7 +708,7 @@ public class DMLScript * @throws LanguageException * @throws LopsException */ - private static void launchDebugger(String dmlScriptStr, String fnameOptConfig, HashMap<String,String> argVals, boolean parsePyDML) + private static void launchDebugger(String dmlScriptStr, String fnameOptConfig, Map<String,String> argVals, boolean parsePyDML) throws ParseException, IOException, DMLRuntimeException, DMLDebuggerException, LanguageException, HopsException, LopsException { DMLDebuggerProgramInfo dbprog = new DMLDebuggerProgramInfo(); @@ -899,7 +900,7 @@ public class DMLScript * @param fnameOptConfig * @param argVals */ - private static void printInvocationInfo(String fnameScript, String fnameOptConfig, HashMap<String,String> argVals) + private static void printInvocationInfo(String fnameScript, String fnameOptConfig, Map<String,String> argVals) { LOG.debug("****** args to DML Script ******\n" + "UUID: " + getUUID() + "\n" + "SCRIPT PATH: " + fnameScript + "\n" + "RUNTIME: " + rtplatform + "\n" + "BUILTIN CONFIG: " + DMLConfig.DEFAULT_SYSTEMML_CONFIG_FILEPATH + "\n" http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/468a366b/src/main/java/org/apache/sysml/api/MLContext.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/api/MLContext.java b/src/main/java/org/apache/sysml/api/MLContext.java index f672235..41c5757 100644 --- a/src/main/java/org/apache/sysml/api/MLContext.java +++ b/src/main/java/org/apache/sysml/api/MLContext.java @@ -23,6 +23,7 @@ package org.apache.sysml.api; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; +import java.util.Map; import java.util.Map.Entry; import java.util.Scanner; @@ -33,6 +34,8 @@ import org.apache.spark.api.java.JavaPairRDD; import org.apache.spark.api.java.JavaRDD; import org.apache.spark.api.java.JavaSparkContext; import org.apache.spark.rdd.RDD; +import org.apache.spark.sql.DataFrame; +import org.apache.spark.sql.SQLContext; import org.apache.sysml.api.DMLScript.RUNTIME_PLATFORM; import org.apache.sysml.api.jmlc.JMLCUtils; import org.apache.sysml.api.monitoring.SparkMonitoringUtil; @@ -50,11 +53,11 @@ import org.apache.sysml.parser.DMLProgram; import org.apache.sysml.parser.DMLTranslator; import org.apache.sysml.parser.DataExpression; import org.apache.sysml.parser.Expression; +import org.apache.sysml.parser.Expression.ValueType; import org.apache.sysml.parser.IntIdentifier; import org.apache.sysml.parser.LanguageException; -import org.apache.sysml.parser.StringIdentifier; -import org.apache.sysml.parser.Expression.ValueType; import org.apache.sysml.parser.ParseException; +import org.apache.sysml.parser.StringIdentifier; import org.apache.sysml.runtime.DMLRuntimeException; import org.apache.sysml.runtime.controlprogram.LocalVariableMap; import org.apache.sysml.runtime.controlprogram.Program; @@ -80,10 +83,8 @@ import org.apache.sysml.runtime.matrix.data.MatrixBlock; import org.apache.sysml.runtime.matrix.data.MatrixIndexes; import org.apache.sysml.runtime.matrix.data.OutputInfo; import org.apache.sysml.utils.Explain; -import org.apache.sysml.utils.Statistics; import org.apache.sysml.utils.Explain.ExplainCounts; -import org.apache.spark.sql.DataFrame; -import org.apache.spark.sql.SQLContext; +import org.apache.sysml.utils.Statistics; /** * MLContext is useful for passing RDDs as input/output to SystemML. This API avoids the need to read/write @@ -195,7 +196,7 @@ public class MLContext { private LocalVariableMap _variables = null; // temporary symbol table private Program _rtprog = null; - private HashMap<String, String> _additionalConfigs = new HashMap<String, String>(); + private Map<String, String> _additionalConfigs = new HashMap<String, String>(); // -------------------------------------------------- // _monitorUtils is set only when MLContext(sc, true) @@ -627,7 +628,7 @@ public class MLContext { * @throws DMLException * @throws ParseException */ - public MLOutput execute(String dmlScriptFilePath, HashMap<String, String> namedArgs, boolean parsePyDML, String configFilePath) throws IOException, DMLException, ParseException { + public MLOutput execute(String dmlScriptFilePath, Map<String, String> namedArgs, boolean parsePyDML, String configFilePath) throws IOException, DMLException, ParseException { String [] args = new String[namedArgs.size()]; int i = 0; for(Entry<String, String> entry : namedArgs.entrySet()) { @@ -649,7 +650,7 @@ public class MLContext { * @throws DMLException * @throws ParseException */ - public MLOutput execute(String dmlScriptFilePath, HashMap<String, String> namedArgs, String configFilePath) throws IOException, DMLException, ParseException { + public MLOutput execute(String dmlScriptFilePath, Map<String, String> namedArgs, String configFilePath) throws IOException, DMLException, ParseException { String [] args = new String[namedArgs.size()]; int i = 0; for(Entry<String, String> entry : namedArgs.entrySet()) { @@ -671,7 +672,7 @@ public class MLContext { * @throws DMLException * @throws ParseException */ - public MLOutput execute(String dmlScriptFilePath, HashMap<String, String> namedArgs) throws IOException, DMLException, ParseException { + public MLOutput execute(String dmlScriptFilePath, Map<String, String> namedArgs) throws IOException, DMLException, ParseException { return execute(dmlScriptFilePath, namedArgs, false, null); } @@ -698,7 +699,7 @@ public class MLContext { * @throws DMLException * @throws ParseException */ - public MLOutput execute(String dmlScriptFilePath, HashMap<String, String> namedArgs, boolean parsePyDML) throws IOException, DMLException, ParseException { + public MLOutput execute(String dmlScriptFilePath, Map<String, String> namedArgs, boolean parsePyDML) throws IOException, DMLException, ParseException { return execute(dmlScriptFilePath, namedArgs, parsePyDML, null); } @@ -1144,12 +1145,12 @@ public class MLContext { return executeScript(dmlScript, new HashMap<String, String>(scala.collection.JavaConversions.mapAsJavaMap(namedArgs)), configFilePath); } - public MLOutput executeScript(String dmlScript, HashMap<String, String> namedArgs) + public MLOutput executeScript(String dmlScript, Map<String, String> namedArgs) throws IOException, DMLException { return executeScript(dmlScript, namedArgs, null); } - public MLOutput executeScript(String dmlScript, HashMap<String, String> namedArgs, String configFilePath) + public MLOutput executeScript(String dmlScript, Map<String, String> namedArgs, String configFilePath) throws IOException, DMLException { String [] args = new String[namedArgs.size()]; int i = 0; @@ -1201,7 +1202,7 @@ public class MLContext { if(DMLScript.rtplatform == RUNTIME_PLATFORM.SPARK || DMLScript.rtplatform == RUNTIME_PLATFORM.HYBRID_SPARK) { - HashMap<String, JavaPairRDD<MatrixIndexes,MatrixBlock>> retVal = null; + Map<String, JavaPairRDD<MatrixIndexes,MatrixBlock>> retVal = null; // Depending on whether registerInput/registerOutput was called initialize the variables String[] inputs; String[] outputs; @@ -1217,9 +1218,9 @@ public class MLContext { else { outputs = new String[0]; } - HashMap<String, MatrixCharacteristics> outMetadata = new HashMap<String, MatrixCharacteristics>(); + Map<String, MatrixCharacteristics> outMetadata = new HashMap<String, MatrixCharacteristics>(); - HashMap<String, String> argVals = DMLScript.createArgumentsMap(isNamedArgument, args); + Map<String, String> argVals = DMLScript.createArgumentsMap(isNamedArgument, args); // Run the DML script ExecutionContext ec = executeUsingSimplifiedCompilationChain(dmlScriptFilePath, isFile, argVals, isPyDML, inputs, outputs, _variables, configFilePath); @@ -1281,7 +1282,7 @@ public class MLContext { * @throws DMLException * @throws ParseException */ - private ExecutionContext executeUsingSimplifiedCompilationChain(String dmlScriptFilePath, boolean isFile, HashMap<String, String> argVals, boolean parsePyDML, + private ExecutionContext executeUsingSimplifiedCompilationChain(String dmlScriptFilePath, boolean isFile, Map<String, String> argVals, boolean parsePyDML, String[] inputs, String[] outputs, LocalVariableMap inputSymbolTable, String configFilePath) throws IOException, DMLException { http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/468a366b/src/main/java/org/apache/sysml/api/MLOutput.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/api/MLOutput.java b/src/main/java/org/apache/sysml/api/MLOutput.java index 0d6856b..a3e6019 100644 --- a/src/main/java/org/apache/sysml/api/MLOutput.java +++ b/src/main/java/org/apache/sysml/api/MLOutput.java @@ -22,6 +22,7 @@ package org.apache.sysml.api; import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Map.Entry; import org.apache.spark.api.java.JavaPairRDD; @@ -37,9 +38,6 @@ import org.apache.spark.sql.SQLContext; import org.apache.spark.sql.types.DataTypes; import org.apache.spark.sql.types.StructField; import org.apache.spark.sql.types.StructType; - -import scala.Tuple2; - import org.apache.sysml.runtime.DMLRuntimeException; import org.apache.sysml.runtime.instructions.spark.functions.GetMLBlock; import org.apache.sysml.runtime.instructions.spark.utils.RDDConverterUtilsExt; @@ -48,6 +46,8 @@ import org.apache.sysml.runtime.matrix.data.MatrixBlock; import org.apache.sysml.runtime.matrix.data.MatrixIndexes; import org.apache.sysml.runtime.util.UtilFunctions; +import scala.Tuple2; + /** * This is a simple container object that returns the output of execute from MLContext * @@ -56,10 +56,10 @@ public class MLOutput { - HashMap<String, JavaPairRDD<MatrixIndexes,MatrixBlock>> _outputs; - private HashMap<String, MatrixCharacteristics> _outMetadata = null; + Map<String, JavaPairRDD<MatrixIndexes,MatrixBlock>> _outputs; + private Map<String, MatrixCharacteristics> _outMetadata = null; - public MLOutput(HashMap<String, JavaPairRDD<MatrixIndexes,MatrixBlock>> outputs, HashMap<String, MatrixCharacteristics> outMetadata) { + public MLOutput(Map<String, JavaPairRDD<MatrixIndexes,MatrixBlock>> outputs, Map<String, MatrixCharacteristics> outMetadata) { this._outputs = outputs; this._outMetadata = outMetadata; } @@ -132,7 +132,7 @@ public class MLOutput { * @return * @throws DMLRuntimeException */ - public DataFrame getDF(SQLContext sqlContext, String varName, HashMap<String, Tuple2<Long, Long>> range) throws DMLRuntimeException { + public DataFrame getDF(SQLContext sqlContext, String varName, Map<String, Tuple2<Long, Long>> range) throws DMLRuntimeException { if(sqlContext == null) { throw new DMLRuntimeException("SQLContext is not created."); } http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/468a366b/src/main/java/org/apache/sysml/api/jmlc/Connection.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/api/jmlc/Connection.java b/src/main/java/org/apache/sysml/api/jmlc/Connection.java index 984268a..b384ca5 100644 --- a/src/main/java/org/apache/sysml/api/jmlc/Connection.java +++ b/src/main/java/org/apache/sysml/api/jmlc/Connection.java @@ -31,6 +31,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; +import java.util.Map; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -75,7 +76,7 @@ import org.apache.wink.json4j.JSONObject; * a {@link Connection} object. The JMLC API is patterned * after JDBC. A DML script is precompiled by calling * the {@link #prepareScript(String, String[], String[], boolean)} - * method or the {@link #prepareScript(String, HashMap, String[], String[], boolean)} + * method or the {@link #prepareScript(String, Map, String[], String[], boolean)} * method on the {@link Connection} object, which returns a * {@link PreparedScript} object. Note that this is similar to calling * a {@code prepareStatement} method on a JDBC {@code Connection} object. @@ -164,7 +165,7 @@ public class Connection * @return PreparedScript object representing the precompiled script * @throws DMLException */ - public PreparedScript prepareScript( String script, HashMap<String, String> args, String[] inputs, String[] outputs, boolean parsePyDML) + public PreparedScript prepareScript( String script, Map<String, String> args, String[] inputs, String[] outputs, boolean parsePyDML) throws DMLException { //prepare arguments @@ -466,7 +467,7 @@ public class Connection } //read meta data (currently only recode supported, without parsing spec) - HashMap<String,String> meta = new HashMap<String,String>(); + Map<String,String> meta = new HashMap<String,String>(); int rows = 0; for( int j=0; j<colnames.size(); j++ ) { String colName = colnames.get(j); @@ -543,7 +544,7 @@ public class Connection } //read meta data (currently only recode supported, without parsing spec) - HashMap<String,String> meta = new HashMap<String,String>(); + Map<String,String> meta = new HashMap<String,String>(); int rows = 0; for( int j=0; j<colnames.size(); j++ ) { String colName = colnames.get(j); @@ -576,7 +577,7 @@ public class Connection * @return * @throws IOException */ - private FrameBlock convertToTransformMetaDataFrame(int rows, List<Integer> recodeIDs, List<String> colnames, HashMap<String,String> meta) + private FrameBlock convertToTransformMetaDataFrame(int rows, List<Integer> recodeIDs, List<String> colnames, Map<String,String> meta) throws IOException { //create frame block w/ pure string schema http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/468a366b/src/main/java/org/apache/sysml/parser/AParserWrapper.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/parser/AParserWrapper.java b/src/main/java/org/apache/sysml/parser/AParserWrapper.java index b22e60b..3d6e865 100644 --- a/src/main/java/org/apache/sysml/parser/AParserWrapper.java +++ b/src/main/java/org/apache/sysml/parser/AParserWrapper.java @@ -23,7 +23,7 @@ import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; -import java.util.HashMap; +import java.util.Map; import org.apache.commons.logging.Log; import org.apache.hadoop.fs.FileSystem; @@ -47,7 +47,7 @@ public abstract class AParserWrapper * @return * @throws ParseException */ - public abstract DMLProgram parse(String fileName, String dmlScript, HashMap<String, String> argVals) + public abstract DMLProgram parse(String fileName, String dmlScript, Map<String, String> argVals) throws ParseException; http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/468a366b/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 bc2653c..023919b 100644 --- a/src/main/java/org/apache/sysml/parser/common/CommonSyntacticValidator.java +++ b/src/main/java/org/apache/sysml/parser/common/CommonSyntacticValidator.java @@ -51,7 +51,6 @@ import org.apache.sysml.parser.PrintStatement; import org.apache.sysml.parser.RelationalExpression; import org.apache.sysml.parser.Statement; import org.apache.sysml.parser.StringIdentifier; -import org.apache.sysml.parser.common.CustomErrorListener; import org.apache.sysml.parser.dml.DmlParser.BuiltinFunctionExpressionContext; import org.apache.sysml.parser.dml.DmlSyntacticValidator; import org.apache.sysml.parser.pydml.PydmlSyntacticValidator; @@ -64,10 +63,10 @@ public abstract class CommonSyntacticValidator { protected final CustomErrorListener errorListener; protected final String currentFile; protected String _workingDir = "."; //current working directory - protected HashMap<String,String> argVals = null; + protected Map<String,String> argVals = null; protected String sourceNamespace = null; - public CommonSyntacticValidator(CustomErrorListener errorListener, HashMap<String,String> argVals, String sourceNamespace) { + public CommonSyntacticValidator(CustomErrorListener errorListener, Map<String,String> argVals, String sourceNamespace) { this.errorListener = errorListener; currentFile = errorListener.getCurrentFileName(); this.argVals = argVals; http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/468a366b/src/main/java/org/apache/sysml/parser/dml/DMLParserWrapper.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/parser/dml/DMLParserWrapper.java b/src/main/java/org/apache/sysml/parser/dml/DMLParserWrapper.java index e802ab5..07829b9 100644 --- a/src/main/java/org/apache/sysml/parser/dml/DMLParserWrapper.java +++ b/src/main/java/org/apache/sysml/parser/dml/DMLParserWrapper.java @@ -23,7 +23,6 @@ import java.io.ByteArrayInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; -import java.util.HashMap; import java.util.List; import java.util.Map; @@ -87,7 +86,7 @@ public class DMLParserWrapper extends AParserWrapper * @throws ParseException */ @Override - public DMLProgram parse(String fileName, String dmlScript, HashMap<String,String> argVals) throws ParseException { + public DMLProgram parse(String fileName, String dmlScript, Map<String,String> argVals) throws ParseException { DMLProgram prog = doParse(fileName, dmlScript, null, argVals); return prog; @@ -102,7 +101,7 @@ public class DMLParserWrapper extends AParserWrapper * @return null if at least one error * @throws ParseException */ - public DMLProgram doParse(String fileName, String dmlScript, String sourceNamespace, HashMap<String,String> argVals) throws ParseException { + public DMLProgram doParse(String fileName, String dmlScript, String sourceNamespace, Map<String,String> argVals) throws ParseException { DMLProgram dmlPgm = null; ANTLRInputStream in; http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/468a366b/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 d7b4019..45a1d3d 100644 --- a/src/main/java/org/apache/sysml/parser/dml/DmlSyntacticValidator.java +++ b/src/main/java/org/apache/sysml/parser/dml/DmlSyntacticValidator.java @@ -24,6 +24,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.Set; import org.antlr.v4.runtime.ParserRuleContext; @@ -111,7 +112,7 @@ import org.apache.sysml.parser.dml.DmlParser.WhileStatementContext; public class DmlSyntacticValidator extends CommonSyntacticValidator implements DmlListener { - public DmlSyntacticValidator(CustomErrorListener errorListener, HashMap<String,String> argVals, String sourceNamespace) { + public DmlSyntacticValidator(CustomErrorListener errorListener, Map<String,String> argVals, String sourceNamespace) { super(errorListener, argVals, sourceNamespace); } http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/468a366b/src/main/java/org/apache/sysml/parser/pydml/PyDMLParserWrapper.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/parser/pydml/PyDMLParserWrapper.java b/src/main/java/org/apache/sysml/parser/pydml/PyDMLParserWrapper.java index cdad7d4..e66d3f6 100644 --- a/src/main/java/org/apache/sysml/parser/pydml/PyDMLParserWrapper.java +++ b/src/main/java/org/apache/sysml/parser/pydml/PyDMLParserWrapper.java @@ -23,7 +23,6 @@ import java.io.ByteArrayInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; -import java.util.HashMap; import java.util.List; import java.util.Map; @@ -71,7 +70,7 @@ public class PyDMLParserWrapper extends AParserWrapper * @throws ParseException */ @Override - public DMLProgram parse(String fileName, String dmlScript, HashMap<String,String> argVals) throws ParseException { + public DMLProgram parse(String fileName, String dmlScript, Map<String,String> argVals) throws ParseException { DMLProgram prog = doParse(fileName, dmlScript, null, argVals); return prog; @@ -86,7 +85,7 @@ public class PyDMLParserWrapper extends AParserWrapper * @return null if at least one error * @throws ParseException */ - public DMLProgram doParse(String fileName, String dmlScript, String sourceNamespace, HashMap<String,String> argVals) throws ParseException { + public DMLProgram doParse(String fileName, String dmlScript, String sourceNamespace, Map<String,String> argVals) throws ParseException { DMLProgram dmlPgm = null; ANTLRInputStream in; http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/468a366b/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 dedaafa..16b253e 100644 --- a/src/main/java/org/apache/sysml/parser/pydml/PydmlSyntacticValidator.java +++ b/src/main/java/org/apache/sysml/parser/pydml/PydmlSyntacticValidator.java @@ -24,6 +24,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.Set; import org.antlr.v4.runtime.ParserRuleContext; @@ -119,7 +120,7 @@ import org.apache.sysml.parser.pydml.PydmlParser.WhileStatementContext; */ public class PydmlSyntacticValidator extends CommonSyntacticValidator implements PydmlListener { - public PydmlSyntacticValidator(CustomErrorListener errorListener, HashMap<String,String> argVals, String sourceNamespace) { + public PydmlSyntacticValidator(CustomErrorListener errorListener, Map<String,String> argVals, String sourceNamespace) { super(errorListener, argVals, sourceNamespace); }