commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r979745 - /commons/proper/proxy/branches/version-2.0-work/stub/src/main/java/org/apache/commons/proxy2/stub/AnnotationFactory.java
Date Tue, 27 Jul 2010 15:21:09 GMT
Author: mbenson
Date: Tue Jul 27 15:21:01 2010
New Revision: 979745

URL: http://svn.apache.org/viewvc?rev=979745&view=rev
Log:
more maximal generics errors

Modified:
    commons/proper/proxy/branches/version-2.0-work/stub/src/main/java/org/apache/commons/proxy2/stub/AnnotationFactory.java

Modified: commons/proper/proxy/branches/version-2.0-work/stub/src/main/java/org/apache/commons/proxy2/stub/AnnotationFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/proxy/branches/version-2.0-work/stub/src/main/java/org/apache/commons/proxy2/stub/AnnotationFactory.java?rev=979745&r1=979744&r2=979745&view=diff
==============================================================================
--- commons/proper/proxy/branches/version-2.0-work/stub/src/main/java/org/apache/commons/proxy2/stub/AnnotationFactory.java
(original)
+++ commons/proper/proxy/branches/version-2.0-work/stub/src/main/java/org/apache/commons/proxy2/stub/AnnotationFactory.java
Tue Jul 27 15:21:01 2010
@@ -99,8 +99,10 @@ public class AnnotationFactory {
      */
     public <A extends Annotation> A create(
             AnnotationStubConfigurer<A> configurer) {
-        return createInternal(Thread.currentThread().getContextClassLoader(),
-                configurer);
+        @SuppressWarnings("unchecked")
+        final A result = (A) createInternal(Thread.currentThread()
+                .getContextClassLoader(), configurer);
+        return result;
     }
 
     /**
@@ -112,7 +114,9 @@ public class AnnotationFactory {
      */
     public <A extends Annotation> A create(ClassLoader classLoader,
             AnnotationStubConfigurer<A> configurer) {
-        return createInternal(classLoader, configurer);
+        @SuppressWarnings("unchecked")
+        final A result = (A) createInternal(classLoader, configurer);
+        return result;
     }
 
     /**
@@ -123,8 +127,10 @@ public class AnnotationFactory {
      * @return stubbed annotation proxy
      */
     public <A extends Annotation> A create(Class<A> annotationType) {
-        return createInternal(Thread.currentThread().getContextClassLoader(),
+        @SuppressWarnings("unchecked")
+        final A result = (A) createInternal(Thread.currentThread().getContextClassLoader(),
                 annotationType);
+        return result;
     }
 
     /**
@@ -136,14 +142,18 @@ public class AnnotationFactory {
      */
     public <A extends Annotation> A create(ClassLoader classLoader,
             Class<A> annotationType) {
-        return createInternal(classLoader, annotationType);
+        @SuppressWarnings("unchecked")
+        final A result = (A) createInternal(classLoader, annotationType);
+        return result;
     }
 
-    private <A extends Annotation> A createInternal(ClassLoader classLoader, Object
configurer) {
+    private <A extends Annotation> A createInternal(ClassLoader classLoader,
+            Object configurer) {
         try {
             CONFIGURER.set(configurer);
             @SuppressWarnings("unchecked")
-            final A result = (A) proxyFactory.createInvokerProxy(classLoader, ANNOTATION_INVOKER,
getStubType());
+            final A result = (A) proxyFactory.createInvokerProxy(classLoader,
+                    ANNOTATION_INVOKER, getStubType());
             return result;
         } finally {
             CONFIGURER.remove();



Mime
View raw message