Skip to content

Commit 9fce029

Browse files
committed
Merge pull request msgpack#75 from august782/master
Fixed to check for interface modifier before checking for abstract modifier. An interface also has the abstract modifier. We should check for interface modifier before checking for abstract modifier no to confuse users by error messages.
2 parents 6a37c20 + 838d641 commit 9fce029

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)