JavaSourceCompilerTest

This commit is contained in:
Looly
2023-03-03 20:43:42 +08:00
parent dc74b829a4
commit ccc316ee8c
2 changed files with 3 additions and 2 deletions

View File

@@ -36,7 +36,7 @@ public class JavaSourceCompilerTest {
// .addLibrary(FileUtil.file("D:\\m2_repo\\cn\\hutool\\hutool-all\\5.5.7\\hutool-all-5.5.7.jar"))
.compile();
final Class<?> clazz = classLoader.loadClass("c.C");
Object obj = ReflectUtil.newInstance(clazz);
final Object obj = ReflectUtil.newInstance(clazz);
Assert.assertTrue(String.valueOf(obj).startsWith("c.C@"));
}
@@ -47,7 +47,7 @@ public class JavaSourceCompilerTest {
CompilerUtil.getCompiler(null)
.addSource(FileUtil.file("test-compile/error/ErrorClazz.java"))
.compile();
} catch (Exception ex) {
} catch (final Exception ex) {
exception = ex;
} finally {
Assert.assertTrue(exception instanceof CompilerException);