[Swift-commit] r5314 - branches/release-0.93/src/org/griphyn/vdl/engine

jonmon at ci.uchicago.edu jonmon at ci.uchicago.edu
Sat Nov 19 21:23:56 CST 2011


Author: jonmon
Date: 2011-11-19 21:23:55 -0600 (Sat, 19 Nov 2011)
New Revision: 5314

Modified:
   branches/release-0.93/src/org/griphyn/vdl/engine/Karajan.java
Log:
commit fix to the import compilation problem



Modified: branches/release-0.93/src/org/griphyn/vdl/engine/Karajan.java
===================================================================
--- branches/release-0.93/src/org/griphyn/vdl/engine/Karajan.java	2011-11-20 01:28:25 UTC (rev 5313)
+++ branches/release-0.93/src/org/griphyn/vdl/engine/Karajan.java	2011-11-20 03:23:55 UTC (rev 5314)
@@ -157,28 +157,23 @@
 				logger.debug("Importing module "+moduleToImport);
 				if(!importedNames.contains(moduleToImport)) {
 
-					// TODO PATH/PERL5LIB-style path handling
-					//String swiftfilename = "./"+moduleToImport+".swift";
-					//String xmlfilename = "./"+moduleToImport+".xml";
 				    String lib_path = System.getenv("SWIFT_LIB");
-					String swiftfilename = moduleToImport+".swift";
-					String xmlfilename = moduleToImport+".xml";
+					String swiftfilename = "./"+moduleToImport+".swift";
+					String xmlfilename = "./"+moduleToImport+".xml";
 
 					File local = new File(swiftfilename);
 					if( !( lib_path == null || local.exists() ) )
 					{
-					    StringTokenizer st = new StringTokenizer(lib_path, ":");
-					    while(st.hasMoreTokens())
+					    String[] path = lib_path.split(":");
+					    for(String entry : path)
 					    {
-					        String path = st.nextToken();
-					        String lib_script_location = path + "/" + swiftfilename;
-					        File tmp = new File(lib_script_location);
+					        String lib_script_location = entry + "/" + swiftfilename;
+					        File file = new File(lib_script_location);
 
-					        if(tmp.exists())
+					        if(file.exists())
 					        {
-					            swiftfilename = path + "/" + swiftfilename;
-					            xmlfilename = path + "/" + xmlfilename;
-					            moduleToImport = path + "/" + moduleToImport;
+					            swiftfilename = entry + "/" + swiftfilename;
+					            moduleToImport = entry + "/" + moduleToImport;
 					            break;
 					        }
 					    }




More information about the Swift-commit mailing list