commit | 4ecce1ba6998d3a58e93b7f3c249628c9bdd55a9 | [log] [tgz] |
---|---|---|
author | Matthew Jason Benson <mbenson@apache.org> | Sat Jun 09 13:28:43 2012 +0000 |
committer | Matthew Jason Benson <mbenson@apache.org> | Sat Jun 09 13:28:43 2012 +0000 |
tree | fcd715cdb0e5a23e9c8b3425f99839dbea186e98 | |
parent | 99d44b9b7f849259f756f2c67a664a45c9dd6270 [diff] |
explain suppressed warning git-svn-id: https://svn.apache.org/repos/asf/commons/proper/proxy/branches/version-2.0-work@1348407 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/stub/src/main/java/org/apache/commons/proxy2/stub/AnnotationFactory.java b/stub/src/main/java/org/apache/commons/proxy2/stub/AnnotationFactory.java index bfa39ee..6e20113 100644 --- a/stub/src/main/java/org/apache/commons/proxy2/stub/AnnotationFactory.java +++ b/stub/src/main/java/org/apache/commons/proxy2/stub/AnnotationFactory.java
@@ -214,9 +214,17 @@ * {@inheritDoc} */ @Override - @SuppressWarnings("unchecked") public Class<Annotation> getStubType() { - return (Class<Annotation>) AnnotationFactory.getStubType(); + /* + * Suppress the warning because we are using this shared object in + * a very special, albeit peculiar way, and effectively + * hijacking the only place where the generic type of the + * instance matters: namely, providing the type of + * Annotation to be stubbed at any given time. + */ + @SuppressWarnings("unchecked") + Class<Annotation> result = (Class<Annotation>) AnnotationFactory.getStubType(); + return result; } /**