[Swift-commit] r5767 - trunk/src/org/griphyn/vdl/karajan/lib/swiftscript

hategan at ci.uchicago.edu hategan at ci.uchicago.edu
Sat Apr 28 20:41:34 CDT 2012


Author: hategan
Date: 2012-04-28 20:41:34 -0500 (Sat, 28 Apr 2012)
New Revision: 5767

Modified:
   trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java
Log:
cleanup

Modified: trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java	2012-04-29 01:40:37 UTC (rev 5766)
+++ trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java	2012-04-29 01:41:34 UTC (rev 5767)
@@ -131,9 +131,6 @@
     }
 
     public DSHandle swiftscript_strcat(VariableStack stack) throws ExecutionException {
-	    if (logger.isDebugEnabled()) {
-	        logger.debug(stack);
-	    }
 		Object[] args = SwiftArg.VARGS.asArray(stack);
 		int provid = VDLFunction.nextProvenanceID();
 		StringBuffer buf = new StringBuffer();
@@ -305,23 +302,9 @@
 	public DSHandle swiftscript_to_int(VariableStack stack)
 	throws ExecutionException {
 		String inputString = TypeUtil.toString(PA_INPUT.getValue(stack));
-		int i = inputString.indexOf(".");
-		if( i >= 0 )
-		{
-			inputString = inputString.substring(0, i);
-		}
-		DSHandle handle = new RootDataNode(Types.INT);
+		
+		DSHandle handle = new RootDataNode(Types.INT, new Double(inputString).intValue());
 
-		try
-		{
-		    handle.setValue(new Integer(inputString));
-		}
-		catch(NumberFormatException e)
-		{
-		    throw new ExecutionException(stack, "Could not convert value \""+inputString+"\" to type int");
-		}
-		handle.closeShallow();
-
 		int provid=VDLFunction.nextProvenanceID();
 		VDLFunction.logProvenanceResult(provid, handle, "toint");
 		VDLFunction.logProvenanceParameter(provid, PA_INPUT.getRawValue(stack), "string");
@@ -445,7 +428,6 @@
 
 	public DSHandle swiftscript_existsfile(VariableStack stack)
     throws ExecutionException {
-	    logger.debug(stack);
 	    DSHandle result = null;
 	    Object[] args = SwiftArg.VARGS.asArray(stack);
 	    String arg = (String) args[0];




More information about the Swift-commit mailing list