Repository: systemml
Updated Branches:
  refs/heads/master a839b30b2 -> 88a52eb04


[SYSTEMML-616] Simplify JMLC/DMLScript APIs (unnecessary exceptions)

This patch cleans up the JMLC and DMLScript APIs by removing unnecessary
DMLExceptions from the public API because. We refrain from removing
checked exceptions (e.g., IOException) for backwards compatibility of
existing applications.


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

Branch: refs/heads/master
Commit: 88a52eb044ecba2e00503339028e8342053f9bf4
Parents: a839b30
Author: Matthias Boehm <mboe...@gmail.com>
Authored: Sat Mar 24 22:49:31 2018 -0700
Committer: Matthias Boehm <mboe...@gmail.com>
Committed: Sat Mar 24 22:49:31 2018 -0700

----------------------------------------------------------------------
 .../java/org/apache/sysml/api/DMLScript.java    | 12 +--
 .../org/apache/sysml/api/jmlc/Connection.java   | 15 +---
 .../org/apache/sysml/api/jmlc/JMLCUtils.java    | 30 +++-----
 .../apache/sysml/api/jmlc/PreparedScript.java   | 80 ++++++--------------
 .../apache/sysml/api/jmlc/ResultVariables.java  | 29 +++----
 .../sysml/hops/codegen/SpoofCompiler.java       | 11 +--
 6 files changed, 50 insertions(+), 127 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/systemml/blob/88a52eb0/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 36a23a0..a84f681 100644
--- a/src/main/java/org/apache/sysml/api/DMLScript.java
+++ b/src/main/java/org/apache/sysml/api/DMLScript.java
@@ -235,10 +235,9 @@ public class DMLScript
         *
         * @param args command-line arguments
         * @throws IOException if an IOException occurs
-        * @throws DMLException if a DMLException occurs
         */
        public static void main(String[] args)
-               throws IOException, DMLException
+               throws IOException
        {
                Configuration conf = new 
Configuration(ConfigurationManager.getCachedJobConf());
                String[] otherArgs = new GenericOptionsParser(conf, 
args).getRemainingArgs();
@@ -452,11 +451,8 @@ public class DMLScript
         * @param conf Hadoop configuration
         * @param args arguments
         * @return true if success, false otherwise
-        * @throws DMLException if DMLException occurs
         */
-       public static boolean executeScript( Configuration conf, String[] args 
) 
-               throws DMLException
-       {
+       public static boolean executeScript( Configuration conf, String[] args 
) {
                //parse arguments and set execution properties
                RUNTIME_PLATFORM oldrtplatform  = rtplatform;  //keep old 
rtplatform
                ExplainType oldexplain          = EXPLAIN;     //keep old 
explain
@@ -956,9 +952,7 @@ public class DMLScript
                return dateFormat.format(date);
        }
 
-       private static void cleanSystemMLWorkspace() 
-               throws DMLException
-       {
+       private static void cleanSystemMLWorkspace() {
                try
                {
                        //read the default config

http://git-wip-us.apache.org/repos/asf/systemml/blob/88a52eb0/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 7940bc5..8e8bb29 100644
--- a/src/main/java/org/apache/sysml/api/jmlc/Connection.java
+++ b/src/main/java/org/apache/sysml/api/jmlc/Connection.java
@@ -186,11 +186,8 @@ public class Connection implements Closeable
         * @param inputs string array of input variables to register
         * @param outputs string array of output variables to register
         * @return PreparedScript object representing the precompiled script
-        * @throws DMLException if DMLException occurs
         */
-       public PreparedScript prepareScript( String script, String[] inputs, 
String[] outputs) 
-               throws DMLException 
-       {
+       public PreparedScript prepareScript( String script, String[] inputs, 
String[] outputs) {
                return prepareScript(script, inputs, outputs, false);
        }
        
@@ -202,11 +199,8 @@ public class Connection implements Closeable
         * @param outputs string array of output variables to register
         * @param parsePyDML {@code true} if PyDML, {@code false} if DML
         * @return PreparedScript object representing the precompiled script
-        * @throws DMLException if DMLException occurs
         */
-       public PreparedScript prepareScript( String script, String[] inputs, 
String[] outputs, boolean parsePyDML) 
-               throws DMLException 
-       {
+       public PreparedScript prepareScript( String script, String[] inputs, 
String[] outputs, boolean parsePyDML) {
                return prepareScript(script, new HashMap<String,String>(), 
inputs, outputs, parsePyDML);
        }
        
@@ -219,11 +213,8 @@ public class Connection implements Closeable
         * @param outputs string array of output variables to register
         * @param parsePyDML {@code true} if PyDML, {@code false} if DML
         * @return PreparedScript object representing the precompiled script
-        * @throws DMLException if DMLException occurs
         */
-       public PreparedScript prepareScript( String script, Map<String, String> 
args, String[] inputs, String[] outputs, boolean parsePyDML) 
-               throws DMLException 
-       {
+       public PreparedScript prepareScript( String script, Map<String, String> 
args, String[] inputs, String[] outputs, boolean parsePyDML) {
                DMLScript.SCRIPT_TYPE = parsePyDML ? ScriptType.PYDML : 
ScriptType.DML;
                
                //check for valid names of passed arguments

http://git-wip-us.apache.org/repos/asf/systemml/blob/88a52eb0/src/main/java/org/apache/sysml/api/jmlc/JMLCUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/api/jmlc/JMLCUtils.java 
b/src/main/java/org/apache/sysml/api/jmlc/JMLCUtils.java
index eb888ba..ed7b6d7 100644
--- a/src/main/java/org/apache/sysml/api/jmlc/JMLCUtils.java
+++ b/src/main/java/org/apache/sysml/api/jmlc/JMLCUtils.java
@@ -48,21 +48,16 @@ public class JMLCUtils
         * @param prog the DML/PyDML program
         * @param outputs registered output variables
         */
-       public static void cleanupRuntimeProgram( Program prog, String[] 
outputs)
-       {
+       public static void cleanupRuntimeProgram( Program prog, String[] 
outputs) {
                Map<String, FunctionProgramBlock> funcMap = 
prog.getFunctionProgramBlocks();
                HashSet<String> blacklist = new 
HashSet<>(Arrays.asList(outputs));
-               
-               if( funcMap != null && !funcMap.isEmpty() )
-               {
-                       for( Entry<String, FunctionProgramBlock> e : 
funcMap.entrySet() )
-                       {
+               if( funcMap != null && !funcMap.isEmpty() ) {
+                       for( Entry<String, FunctionProgramBlock> e : 
funcMap.entrySet() ) {
                                FunctionProgramBlock fpb = e.getValue();
                                for( ProgramBlock pb : fpb.getChildBlocks() )
                                        rCleanupRuntimeProgram(pb, blacklist);
                        }
                }
-               
                for( ProgramBlock pb : prog.getProgramBlocks() )
                        rCleanupRuntimeProgram(pb, blacklist);
        }
@@ -73,24 +68,20 @@ public class JMLCUtils
         * @param pb program block
         * @param outputs registered output variables
         */
-       public static void rCleanupRuntimeProgram( ProgramBlock pb, 
HashSet<String> outputs )
-       {
-               if( pb instanceof WhileProgramBlock )
-               {
+       public static void rCleanupRuntimeProgram( ProgramBlock pb, 
HashSet<String> outputs ) {
+               if( pb instanceof WhileProgramBlock ) {
                        WhileProgramBlock wpb = (WhileProgramBlock)pb;
                        for( ProgramBlock pbc : wpb.getChildBlocks() )
                                rCleanupRuntimeProgram(pbc,outputs);
                }
-               else if( pb instanceof IfProgramBlock )
-               {
+               else if( pb instanceof IfProgramBlock ) {
                        IfProgramBlock ipb = (IfProgramBlock)pb;
                        for( ProgramBlock pbc : ipb.getChildBlocksIfBody() )
                                rCleanupRuntimeProgram(pbc,outputs);
                        for( ProgramBlock pbc : ipb.getChildBlocksElseBody() )
                                rCleanupRuntimeProgram(pbc,outputs);
                }
-               else if( pb instanceof ForProgramBlock )
-               {
+               else if( pb instanceof ForProgramBlock ) {
                        ForProgramBlock fpb = (ForProgramBlock)pb;
                        for( ProgramBlock pbc : fpb.getChildBlocks() )
                                rCleanupRuntimeProgram(pbc,outputs);
@@ -121,13 +112,10 @@ public class JMLCUtils
         * @param outputs registered output variables
         * @return list of instructions
         */
-       public static ArrayList<Instruction> cleanupRuntimeInstructions( 
ArrayList<Instruction> insts, HashSet<String> outputs )
-       {
+       public static ArrayList<Instruction> cleanupRuntimeInstructions( 
ArrayList<Instruction> insts, HashSet<String> outputs ) {
                ArrayList<Instruction> ret = new ArrayList<>();
-               
                for( Instruction inst : insts ) {
-                       if( inst instanceof VariableCPInstruction && 
((VariableCPInstruction)inst).isRemoveVariable() )
-                       {
+                       if( inst instanceof VariableCPInstruction && 
((VariableCPInstruction)inst).isRemoveVariable() ) {
                                ArrayList<String> currRmVar = new ArrayList<>();
                                for( CPOperand input : 
((VariableCPInstruction)inst).getInputs() )
                                        if( !outputs.contains(input.getName()) )

http://git-wip-us.apache.org/repos/asf/systemml/blob/88a52eb0/src/main/java/org/apache/sysml/api/jmlc/PreparedScript.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/api/jmlc/PreparedScript.java 
b/src/main/java/org/apache/sysml/api/jmlc/PreparedScript.java
index 70a3eb8..c0d0be2 100644
--- a/src/main/java/org/apache/sysml/api/jmlc/PreparedScript.java
+++ b/src/main/java/org/apache/sysml/api/jmlc/PreparedScript.java
@@ -103,8 +103,7 @@ public class PreparedScript implements ConfigurableAPI
         * @param dmlconf dml configuration 
         * @param cconf compiler configuration
         */
-       protected PreparedScript( Program prog, String[] inputs, String[] 
outputs, DMLConfig dmlconf, CompilerConfig cconf ) 
-       {
+       protected PreparedScript( Program prog, String[] inputs, String[] 
outputs, DMLConfig dmlconf, CompilerConfig cconf ) {
                _prog = prog;
                _vars = new LocalVariableMap();
                
@@ -164,9 +163,8 @@ public class PreparedScript implements ConfigurableAPI
         * 
         * @param varname input variable name
         * @param scalar boolean value
-        * @throws DMLException if DMLException occurs
         */
-       public void setScalar(String varname, boolean scalar) throws 
DMLException {
+       public void setScalar(String varname, boolean scalar) {
                setScalar(varname, scalar, false);
        }
        
@@ -176,9 +174,8 @@ public class PreparedScript implements ConfigurableAPI
         * @param varname input variable name
         * @param scalar boolean value
         * @param reuse if {@code true}, preserve value over multiple {@code 
executeScript} calls
-        * @throws DMLException if DMLException occurs
         */
-       public void setScalar(String varname, boolean scalar, boolean reuse) 
throws DMLException {
+       public void setScalar(String varname, boolean scalar, boolean reuse) {
                setScalar(varname, new BooleanObject(scalar), reuse);
        }
        
@@ -187,9 +184,8 @@ public class PreparedScript implements ConfigurableAPI
         * 
         * @param varname input variable name
         * @param scalar long value
-        * @throws DMLException if DMLException occurs
         */
-       public void setScalar(String varname, long scalar) throws DMLException {
+       public void setScalar(String varname, long scalar) {
                setScalar(varname, scalar, false);
        }
        
@@ -199,9 +195,8 @@ public class PreparedScript implements ConfigurableAPI
         * @param varname input variable name
         * @param scalar long value
         * @param reuse if {@code true}, preserve value over multiple {@code 
executeScript} calls
-        * @throws DMLException if DMLException occurs
         */
-       public void setScalar(String varname, long scalar, boolean reuse) 
throws DMLException {
+       public void setScalar(String varname, long scalar, boolean reuse) {
                setScalar(varname, new IntObject(scalar), reuse);
        }
        
@@ -209,9 +204,8 @@ public class PreparedScript implements ConfigurableAPI
         * 
         * @param varname input variable name
         * @param scalar double value
-        * @throws DMLException if DMLException occurs
         */
-       public void setScalar(String varname, double scalar) throws 
DMLException {
+       public void setScalar(String varname, double scalar) {
                setScalar(varname, scalar, false);
        }
        
@@ -221,9 +215,8 @@ public class PreparedScript implements ConfigurableAPI
         * @param varname input variable name
         * @param scalar double value
         * @param reuse if {@code true}, preserve value over multiple {@code 
executeScript} calls
-        * @throws DMLException if DMLException occurs
         */
-       public void setScalar(String varname, double scalar, boolean reuse) 
throws DMLException {
+       public void setScalar(String varname, double scalar, boolean reuse) {
                setScalar(varname, new DoubleObject(scalar), reuse);
        }
        
@@ -232,9 +225,8 @@ public class PreparedScript implements ConfigurableAPI
         * 
         * @param varname input variable name
         * @param scalar string value
-        * @throws DMLException if DMLException occurs
         */
-       public void setScalar(String varname, String scalar) throws 
DMLException {
+       public void setScalar(String varname, String scalar) {
                setScalar(varname, scalar, false);
        }
        
@@ -244,9 +236,8 @@ public class PreparedScript implements ConfigurableAPI
         * @param varname input variable name
         * @param scalar string value
         * @param reuse if {@code true}, preserve value over multiple {@code 
executeScript} calls
-        * @throws DMLException if DMLException occurs
         */
-       public void setScalar(String varname, String scalar, boolean reuse) 
throws DMLException {
+       public void setScalar(String varname, String scalar, boolean reuse) {
                setScalar(varname, new StringObject(scalar), reuse);
        }
 
@@ -258,14 +249,10 @@ public class PreparedScript implements ConfigurableAPI
         * @param varname input variable name
         * @param scalar scalar object
         * @param reuse if {@code true}, preserve value over multiple {@code 
executeScript} calls
-        * @throws DMLException if DMLException occurs
         */
-       public void setScalar(String varname, ScalarObject scalar, boolean 
reuse) 
-               throws DMLException
-       {
+       public void setScalar(String varname, ScalarObject scalar, boolean 
reuse) {
                if( !_inVarnames.contains(varname) )
                        throw new DMLException("Unspecified input variable: 
"+varname);
-               
                _vars.put(varname, scalar);
        }
 
@@ -274,9 +261,8 @@ public class PreparedScript implements ConfigurableAPI
         * 
         * @param varname input variable name
         * @param matrix two-dimensional double array matrix representation
-        * @throws DMLException if DMLException occurs
         */
-       public void setMatrix(String varname, double[][] matrix) throws 
DMLException {
+       public void setMatrix(String varname, double[][] matrix) {
                setMatrix(varname, matrix, false);
        }
        
@@ -286,9 +272,8 @@ public class PreparedScript implements ConfigurableAPI
         * @param varname input variable name
         * @param matrix two-dimensional double array matrix representation
         * @param reuse if {@code true}, preserve value over multiple {@code 
executeScript} calls
-        * @throws DMLException if DMLException occurs
         */
-       public void setMatrix(String varname, double[][] matrix, boolean reuse) 
throws DMLException {
+       public void setMatrix(String varname, double[][] matrix, boolean reuse) 
{
                setMatrix(varname, DataConverter.convertToMatrixBlock(matrix), 
reuse);
        }
        
@@ -300,11 +285,8 @@ public class PreparedScript implements ConfigurableAPI
         * @param varname input variable name
         * @param matrix matrix represented as a MatrixBlock
         * @param reuse if {@code true}, preserve value over multiple {@code 
executeScript} calls
-        * @throws DMLException if DMLException occurs
         */
-       public void setMatrix(String varname, MatrixBlock matrix, boolean reuse)
-               throws DMLException
-       {
+       public void setMatrix(String varname, MatrixBlock matrix, boolean 
reuse) {
                if( !_inVarnames.contains(varname) )
                        throw new DMLException("Unspecified input variable: 
"+varname);
                                
@@ -330,9 +312,8 @@ public class PreparedScript implements ConfigurableAPI
         * 
         * @param varname input variable name
         * @param frame two-dimensional string array frame representation
-        * @throws DMLException if DMLException occurs
         */
-       public void setFrame(String varname, String[][] frame) throws 
DMLException {
+       public void setFrame(String varname, String[][] frame) {
                setFrame(varname, frame, false);
        }
        
@@ -342,9 +323,8 @@ public class PreparedScript implements ConfigurableAPI
         * @param varname input variable name
         * @param frame two-dimensional string array frame representation
         * @param schema list representing the types of the frame columns
-        * @throws DMLException if DMLException occurs
         */
-       public void setFrame(String varname, String[][] frame, List<ValueType> 
schema) throws DMLException {
+       public void setFrame(String varname, String[][] frame, List<ValueType> 
schema) {
                setFrame(varname, frame, schema, false);
        }
        
@@ -355,9 +335,8 @@ public class PreparedScript implements ConfigurableAPI
         * @param frame two-dimensional string array frame representation
         * @param schema list representing the types of the frame columns
         * @param colnames frame column names
-        * @throws DMLException if DMLException occurs
         */
-       public void setFrame(String varname, String[][] frame, List<ValueType> 
schema, List<String> colnames) throws DMLException {
+       public void setFrame(String varname, String[][] frame, List<ValueType> 
schema, List<String> colnames) {
                setFrame(varname, frame, schema, colnames, false);
        }
        
@@ -367,9 +346,8 @@ public class PreparedScript implements ConfigurableAPI
         * @param varname input variable name
         * @param frame two-dimensional string array frame representation
         * @param reuse if {@code true}, preserve value over multiple {@code 
executeScript} calls
-        * @throws DMLException if DMLException occurs
         */
-       public void setFrame(String varname, String[][] frame, boolean reuse) 
throws DMLException {
+       public void setFrame(String varname, String[][] frame, boolean reuse) {
                setFrame(varname, DataConverter.convertToFrameBlock(frame), 
reuse);
        }
        
@@ -380,9 +358,8 @@ public class PreparedScript implements ConfigurableAPI
         * @param frame two-dimensional string array frame representation
         * @param schema list representing the types of the frame columns
         * @param reuse if {@code true}, preserve value over multiple {@code 
executeScript} calls
-        * @throws DMLException if DMLException occurs
         */
-       public void setFrame(String varname, String[][] frame, List<ValueType> 
schema, boolean reuse) throws DMLException {
+       public void setFrame(String varname, String[][] frame, List<ValueType> 
schema, boolean reuse) {
                setFrame(varname, DataConverter.convertToFrameBlock(frame, 
schema.toArray(new ValueType[0])), reuse);
        }
        
@@ -394,9 +371,8 @@ public class PreparedScript implements ConfigurableAPI
         * @param schema list representing the types of the frame columns
         * @param colnames frame column names
         * @param reuse if {@code true}, preserve value over multiple {@code 
executeScript} calls
-        * @throws DMLException if DMLException occurs
         */
-       public void setFrame(String varname, String[][] frame, List<ValueType> 
schema, List<String> colnames, boolean reuse) throws DMLException {
+       public void setFrame(String varname, String[][] frame, List<ValueType> 
schema, List<String> colnames, boolean reuse) {
                setFrame(varname, DataConverter.convertToFrameBlock( frame, 
                                schema.toArray(new ValueType[0]), 
colnames.toArray(new String[0])), reuse);
        }
@@ -409,11 +385,8 @@ public class PreparedScript implements ConfigurableAPI
         * @param varname input variable name
         * @param frame frame represented as a FrameBlock
         * @param reuse if {@code true}, preserve value over multiple {@code 
executeScript} calls
-        * @throws DMLException if DMLException occurs
         */
-       public void setFrame(String varname, FrameBlock frame, boolean reuse)
-               throws DMLException
-       {
+       public void setFrame(String varname, FrameBlock frame, boolean reuse) {
                if( !_inVarnames.contains(varname) )
                        throw new DMLException("Unspecified input variable: 
"+varname);
                
@@ -445,11 +418,8 @@ public class PreparedScript implements ConfigurableAPI
         * result variables according to bound and registered outputs.
         * 
         * @return ResultVariables object encapsulating output results
-        * @throws DMLException if DMLException occurs
         */
-       public ResultVariables executeScript() 
-               throws DMLException
-       {
+       public ResultVariables executeScript() {
                //add reused variables
                _vars.putAll(_inVarReuse);
                
@@ -484,9 +454,8 @@ public class PreparedScript implements ConfigurableAPI
         * Explain the DML/PyDML program and view result as a string.
         * 
         * @return string results of explain
-        * @throws DMLException if DMLException occurs
         */
-       public String explain() throws DMLException {
+       public String explain() {
                return Explain.explain(_prog);
        }
        
@@ -501,11 +470,8 @@ public class PreparedScript implements ConfigurableAPI
         * 
         * @param fnamespace function namespace, null for default namespace
         * @param fnames function name
-        * @throws DMLException if any compilation error occurs
         */
-       public void enableFunctionRecompile(String fnamespace, String... 
fnames) 
-               throws DMLException 
-       {
+       public void enableFunctionRecompile(String fnamespace, String... 
fnames) {
                //handle default name space
                if( fnamespace == null )
                        fnamespace = DMLProgram.DEFAULT_NAMESPACE;

http://git-wip-us.apache.org/repos/asf/systemml/blob/88a52eb0/src/main/java/org/apache/sysml/api/jmlc/ResultVariables.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/api/jmlc/ResultVariables.java 
b/src/main/java/org/apache/sysml/api/jmlc/ResultVariables.java
index 289355b..ba9e509 100644
--- a/src/main/java/org/apache/sysml/api/jmlc/ResultVariables.java
+++ b/src/main/java/org/apache/sysml/api/jmlc/ResultVariables.java
@@ -68,9 +68,8 @@ public class ResultVariables
         * 
         * @param varname output variable name
         * @return matrix as a two-dimensional double array
-        * @throws DMLException if DMLException occurs
         */
-       public double[][] getMatrix(String varname) throws DMLException {
+       public double[][] getMatrix(String varname) {
                return 
DataConverter.convertToDoubleMatrix(getMatrixBlock(varname));
        }
        
@@ -80,9 +79,8 @@ public class ResultVariables
         * 
         * @param varname output variable name
         * @return matrix as matrix block
-        * @throws DMLException if DMLException occurs
         */
-       public MatrixBlock getMatrixBlock(String varname) throws DMLException {
+       public MatrixBlock getMatrixBlock(String varname) {
                Data dat = _out.get(varname);
                if( dat == null )
                        throw new DMLException("Non-existent output variable: 
"+varname);
@@ -103,9 +101,8 @@ public class ResultVariables
         * 
         * @param varname output variable name
         * @return frame as a two-dimensional string array
-        * @throws DMLException if DMLException occurs
         */
-       public String[][] getFrame(String varname) throws DMLException {
+       public String[][] getFrame(String varname) {
                return 
DataConverter.convertToStringFrame(getFrameBlock(varname));
        }
        
@@ -115,11 +112,8 @@ public class ResultVariables
         * 
         * @param varname output variable name
         * @return frame as a frame block
-        * @throws DMLException if DMLException occurs
         */
-       public FrameBlock getFrameBlock(String varname) 
-               throws DMLException
-       {
+       public FrameBlock getFrameBlock(String varname) {
                Data dat = _out.get(varname);
                if( dat == null )
                        throw new DMLException("Non-existent output variable: 
"+varname);
@@ -141,9 +135,8 @@ public class ResultVariables
         * @param varname
         *            output variable name
         * @return double value
-        * @throws DMLException if DMLException occurs
         */
-       public double getDouble(String varname) throws DMLException {
+       public double getDouble(String varname) {
                return getScalarObject(varname).getDoubleValue();
        }
 
@@ -153,9 +146,8 @@ public class ResultVariables
         * @param varname
         *            output variable name
         * @return boolean value
-        * @throws DMLException if DMLException occurs
         */
-       public boolean getBoolean(String varname) throws DMLException {
+       public boolean getBoolean(String varname) {
                return getScalarObject(varname).getBooleanValue();
        }
 
@@ -165,9 +157,8 @@ public class ResultVariables
         * @param varname
         *            output variable name
         * @return long value
-        * @throws DMLException if DMLException occurs
         */
-       public long getLong(String varname) throws DMLException {
+       public long getLong(String varname) {
                return getScalarObject(varname).getLongValue();
        }
 
@@ -177,9 +168,8 @@ public class ResultVariables
         * @param varname
         *            output variable name
         * @return string value
-        * @throws DMLException if DMLException occurs
         */
-       public String getString(String varname) throws DMLException {
+       public String getString(String varname) {
                return getScalarObject(varname).getStringValue();
        }
 
@@ -189,9 +179,8 @@ public class ResultVariables
         * @param varname
         *            output variable name
         * @return ScalarObject
-        * @throws DMLException if DMLException occurs
         */
-       public ScalarObject getScalarObject(String varname) throws DMLException 
{
+       public ScalarObject getScalarObject(String varname) {
                Data dat = _out.get(varname);
                if( dat == null )
                        throw new DMLException("Non-existent output variable: " 
+ varname);

http://git-wip-us.apache.org/repos/asf/systemml/blob/88a52eb0/src/main/java/org/apache/sysml/hops/codegen/SpoofCompiler.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/hops/codegen/SpoofCompiler.java 
b/src/main/java/org/apache/sysml/hops/codegen/SpoofCompiler.java
index e4a6f49..932b0be 100644
--- a/src/main/java/org/apache/sysml/hops/codegen/SpoofCompiler.java
+++ b/src/main/java/org/apache/sysml/hops/codegen/SpoofCompiler.java
@@ -32,7 +32,6 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
-import org.apache.sysml.api.DMLException;
 import org.apache.sysml.api.DMLScript;
 import org.apache.sysml.api.DMLScript.RUNTIME_PLATFORM;
 import org.apache.sysml.conf.ConfigurationManager;
@@ -489,9 +488,7 @@ public class SpoofCompiler
        ////////////////////
        // Codegen plan construction
        
-       private static void rExploreCPlans(Hop hop, CPlanMemoTable memo, 
boolean compileLiterals) 
-               throws DMLException
-       {
+       private static void rExploreCPlans(Hop hop, CPlanMemoTable memo, 
boolean compileLiterals) {
                //top-down memoization of processed dag nodes
                if( memo.contains(hop.getHopID()) || memo.containsHop(hop) )
                        return;
@@ -545,9 +542,7 @@ public class SpoofCompiler
                return P;
        }
        
-       private static void rConstructCPlans(Hop hop, CPlanMemoTable memo, 
HashMap<Long, Pair<Hop[],CNodeTpl>> cplans, boolean compileLiterals, 
HashSet<Long> visited) 
-               throws DMLException
-       {
+       private static void rConstructCPlans(Hop hop, CPlanMemoTable memo, 
HashMap<Long, Pair<Hop[],CNodeTpl>> cplans, boolean compileLiterals, 
HashSet<Long> visited) {
                //top-down memoization of processed dag nodes
                if( hop == null || visited.contains(hop.getHopID()) )
                        return;
@@ -568,7 +563,7 @@ public class SpoofCompiler
                }
                else {
                        for( Hop c : hop.getInput() )
-                               rConstructCPlans(c, memo, cplans, 
compileLiterals, visited);    
+                               rConstructCPlans(c, memo, cplans, 
compileLiterals, visited);
                }
                
                visited.add(hop.getHopID());

Reply via email to