Mercurial Hosting > luan
comparison src/luan/impl/LuanCompiler.java @ 1625:57c8baadb357
handle UnsupportedClassVersionError
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 05 Sep 2021 12:32:27 -0600 |
parents | 8fbcc4747091 |
children |
comparison
equal
deleted
inserted
replaced
1624:fe611f6e3c28 | 1625:57c8baadb357 |
---|---|
71 //Compiled compiled = null; | 71 //Compiled compiled = null; |
72 if( compiled==null ) { | 72 if( compiled==null ) { |
73 compiled = getCompiled(sourceText,sourceName,null); | 73 compiled = getCompiled(sourceText,sourceName,null); |
74 compiled.save(fileName,key); | 74 compiled.save(fileName,key); |
75 } | 75 } |
76 Class cls = compiled.loadClass(); | 76 Class cls; |
77 try { | |
78 cls = compiled.loadClass(); | |
79 } catch(UnsupportedClassVersionError e) { | |
80 compiled = getCompiled(sourceText,sourceName,null); | |
81 compiled.save(fileName,key); | |
82 cls = compiled.loadClass(); | |
83 } | |
77 map.put(key,new WeakReference<Class>(cls)); | 84 map.put(key,new WeakReference<Class>(cls)); |
78 return cls; | 85 return cls; |
79 } | 86 } |
80 | 87 |
81 private static Class getClass(String sourceText,String sourceName,LuanTable env) | 88 private static Class getClass(String sourceText,String sourceName,LuanTable env) |