fix PinyinUtil在Jdk17下报错

This commit is contained in:
zhangxinjie 2023-08-02 17:00:28 +08:00
parent 8585ecc1eb
commit 69baf6d0f0

View File

@ -32,7 +32,9 @@ public class PinyinEngineFactory {
* @return 单例的PinyinEngine * @return 单例的PinyinEngine
*/ */
public static PinyinEngine getEngine(){ public static PinyinEngine getEngine(){
return Singleton.get(PinyinEngine.class.getName(), PinyinEngineFactory::createEngine); final PinyinEngine engine = Singleton.get(PinyinEngine.class.getName(), PinyinEngineFactory::createEngine);
LogUtil.debug("Use [{}] Engine As Default.", StrUtil.removeSuffix(engine.getClass().getSimpleName(), "Engine"));
return engine;
} }
/** /**
@ -42,9 +44,7 @@ public class PinyinEngineFactory {
* @return {@link PinyinEngine} * @return {@link PinyinEngine}
*/ */
public static PinyinEngine createEngine() { public static PinyinEngine createEngine() {
final PinyinEngine engine = doCreateEngine(); return doCreateEngine();
LogUtil.debug("Use [{}] Engine As Default.", StrUtil.removeSuffix(engine.getClass().getSimpleName(), "Engine"));
return engine;
} }
/** /**