mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
fix issue#I7PHNT
This commit is contained in:
parent
8ff4e14e1d
commit
9a82679dd9
@ -34,6 +34,13 @@ import java.net.URL;
|
||||
*/
|
||||
public class LogEngineFactory {
|
||||
|
||||
/**
|
||||
* issue#I7PHNT,嵌套使用Singleton.get时在JDK9+会引起Recursive update问题,此处日志单独使用单例
|
||||
*/
|
||||
private static class InstanceHolder {
|
||||
public static final LogEngine INSTANCE = createEngine();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户引入的模板引擎jar,自动创建对应的模板引擎对象<br>
|
||||
* 获得的是单例的TemplateEngine
|
||||
@ -41,7 +48,7 @@ public class LogEngineFactory {
|
||||
* @return 单例的TemplateEngine
|
||||
*/
|
||||
public static LogEngine getEngine() {
|
||||
return Singleton.get(LogEngineFactory.class.getName(), LogEngineFactory::createEngine);
|
||||
return InstanceHolder.INSTANCE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user