Skip to content

Commit 838d641

Browse files
committed
Patch: an interface also has the abstract modifier, so in order to correctly check if a passed in type is an interface, should check for interface modifier before checking for abstract modifier
1 parent 6559a77 commit 838d641

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/java/org/msgpack/template/builder/AbstractTemplateBuilder.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@ public <T> Template<T> buildTemplate(final Class<T> targetClass, final FieldList
7272
protected abstract <T> Template<T> buildTemplate(Class<T> targetClass, FieldEntry[] entries);
7373

7474
protected void checkClassValidation(final Class<?> targetClass) {
75-
if (Modifier.isAbstract(targetClass.getModifiers())) {
76-
throw new TemplateBuildException(
77-
"Cannot build template for abstract class: " + targetClass.getName());
78-
}
7975
if (targetClass.isInterface()) {
8076
throw new TemplateBuildException(
8177
"Cannot build template for interface: " + targetClass.getName());
8278
}
79+
if (Modifier.isAbstract(targetClass.getModifiers())) {
80+
throw new TemplateBuildException(
81+
"Cannot build template for abstract class: " + targetClass.getName());
82+
}
8383
if (targetClass.isArray()) {
8484
throw new TemplateBuildException(
8585
"Cannot build template for array class: " + targetClass.getName());

0 commit comments

Comments
 (0)