/*
- * Copyright 2011 BitMeister Inc.
+ * Copyright 2011-2012 BitMeister Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
.getAnnotation(ASN1Element.class), f));
}
}
- @SuppressWarnings("unchecked")
- Class<? extends ConstructiveType> parent = (Class<? extends ConstructiveType>) type
- .getSuperclass();
+ Class<? extends ConstructiveType> parent = type.getSuperclass().asSubclass(ConstructiveType.class);
ElementSpecification[] array;
if (parent == SET.class || parent == SEQUENCE.class
|| parent.isAnnotationPresent(ASN1Extendable.class)) {