This commit is contained in:
Redkale
2018-02-08 16:37:18 +08:00
parent 433c0db4fb
commit 38bd9fb204

View File

@@ -204,10 +204,8 @@ public final class ObjectDecoder<R extends Reader, T> implements Decodeable<R, T
} }
} }
if (this.creator == null) { if (this.creator == null) {
synchronized (lock) { if (typeClass.isInterface() || Modifier.isAbstract(typeClass.getModifiers())) {
if (this.creator == null) { throw new ConvertException("[" + typeClass + "] is a interface or abstract class, cannot create it's Creator.");
this.creator = factory.loadCreator(this.typeClass);
}
} }
} }
if (this.creatorConstructorMembers == null) { //空构造函数 if (this.creatorConstructorMembers == null) { //空构造函数