[Swift-commit] r2746 - trunk/src/org/griphyn/vdl/karajan

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Fri Mar 27 03:47:40 CDT 2009


Author: benc
Date: 2009-03-27 03:47:39 -0500 (Fri, 27 Mar 2009)
New Revision: 2746

Modified:
   trunk/src/org/griphyn/vdl/karajan/Loader.java
Log:
fix bug 189  - recompilation is incorrectly suppressed when kml file is empty.

Modified: trunk/src/org/griphyn/vdl/karajan/Loader.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/Loader.java	2009-03-25 22:19:27 UTC (rev 2745)
+++ trunk/src/org/griphyn/vdl/karajan/Loader.java	2009-03-27 08:47:39 UTC (rev 2746)
@@ -220,21 +220,26 @@
 			Reader fr = new FileReader(kml);
 			BufferedReader br = new BufferedReader(fr);
 			String firstLine = br.readLine();
-			String prefix = "<!-- CACHE ID ";
-			int offset = firstLine.indexOf(prefix);
-			if(offset < 0) {
-				// no build version in the KML
-				logger.info(project + ": has no build version. Recompiling.");
+			if(firstLine == null) {
+				logger.debug("KML file is empty. Recompiling.");
 				recompile = true;
 			} else {
-				String cut = firstLine.substring(offset+prefix.length());
-				int endOffset = cut.indexOf(" -->");
-				String kmlversion = cut.substring(0,endOffset);
-				logger.debug("kmlversion is >"+kmlversion+"<");
-				logger.debug("build version is >"+buildVersion+"<");
-				if(!(kmlversion.equals(buildVersion))) {
-					logger.info(project + ": source file was compiled with a different version of Swift. Recompiling.");
-					recompile=true;
+				String prefix = "<!-- CACHE ID ";
+				int offset = firstLine.indexOf(prefix);
+				if(offset < 0) {
+					// no build version in the KML
+					logger.info(project + ": has no build version. Recompiling.");
+					recompile = true;
+				} else {
+					String cut = firstLine.substring(offset+prefix.length());
+					int endOffset = cut.indexOf(" -->");
+					String kmlversion = cut.substring(0,endOffset);
+					logger.debug("kmlversion is >"+kmlversion+"<");
+					logger.debug("build version is >"+buildVersion+"<");
+					if(!(kmlversion.equals(buildVersion))) {
+						logger.info(project + ": source file was compiled with a different version of Swift. Recompiling.");
+						recompile=true;
+					}
 				}
 			}
 		}




More information about the Swift-commit mailing list