changeset 1625:57c8baadb357

handle UnsupportedClassVersionError
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 05 Sep 2021 12:32:27 -0600
parents fe611f6e3c28
children cf9dfead83a3
files src/luan/impl/LuanCompiler.java
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
diff -r fe611f6e3c28 -r 57c8baadb357 src/luan/impl/LuanCompiler.java
--- a/src/luan/impl/LuanCompiler.java	Sat Aug 07 20:01:46 2021 -0600
+++ b/src/luan/impl/LuanCompiler.java	Sun Sep 05 12:32:27 2021 -0600
@@ -73,7 +73,14 @@
 			compiled = getCompiled(sourceText,sourceName,null);
 			compiled.save(fileName,key);
 		}
-		Class cls = compiled.loadClass();
+		Class cls;
+		try {
+			cls = compiled.loadClass();
+		} catch(UnsupportedClassVersionError e) {
+			compiled = getCompiled(sourceText,sourceName,null);
+			compiled.save(fileName,key);
+			cls = compiled.loadClass();
+		}
 		map.put(key,new WeakReference<Class>(cls));
 		return cls;
 	}