提交 dc6ecf51 authored 作者: noelgrandin's avatar noelgrandin

fix the singleton check

上级 3fc9d62a
...@@ -82,10 +82,10 @@ public class CompareMode { ...@@ -82,10 +82,10 @@ public class CompareMode {
*/ */
public static synchronized CompareMode getInstance(String name, int strength, boolean binaryUnsigned) { public static synchronized CompareMode getInstance(String name, int strength, boolean binaryUnsigned) {
if (lastUsed != null) { if (lastUsed != null) {
if (StringUtils.equals(lastUsed.name, name)) { if (StringUtils.equals(lastUsed.name, name) &&
if (lastUsed.strength == strength) { lastUsed.strength == strength &&
return lastUsed; lastUsed.binaryUnsigned == binaryUnsigned) {
} return lastUsed;
} }
} }
if (name == null || name.equals(OFF)) { if (name == null || name.equals(OFF)) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论