Skip to content

Commit

Permalink
support none-static member class, fix issue #367
Browse files Browse the repository at this point in the history
  • Loading branch information
wenshao committed Sep 22, 2022
1 parent 88c3313 commit 0eedbc3
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -678,18 +678,18 @@ public <T> ObjectReader<T> createObjectReader(Class<T> objectClass, Type objectT
defaultConstructor = constructor;
}

if (creatorConstructor == null) {
if (declaringClass != null
&& constructor.getParameterCount() == 1
&& declaringClass.equals(constructor.getParameterTypes()[0])) {
creatorConstructor = constructor;
index = i;
} else if (constructor.getParameterCount() == 0) {
break;
} else if (creatorConstructor == null) {
creatorConstructor = constructor;
index = i;
} else if (declaringClass != null
&& constructor.getParameterCount() == 1
&& declaringClass.equals(constructor.getParameterTypes()[0])) {
} else if (constructor.getParameterCount() == 0) {
creatorConstructor = constructor;
index = i;
break;
} else if (creatorConstructor.getParameterCount() < constructor.getParameterCount()) {
creatorConstructor = constructor;
index = i;
Expand Down

0 comments on commit 0eedbc3

Please # to comment.