OSDN Git Service

X.690 Amendment1 (10/2003)
[bm-asn1/bm-asn1.git] / jp / bitmeister / asn1 / type / ConstructiveType.java
index 7614dd2..3320ae4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -68,9 +68,7 @@ public abstract class ConstructiveType extends StructuredType {
                                                .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)) {