r135 - in trunk: cantharella.data cantharella.service cantharella.utils cantharella.utils/src/main/java/nc/ird/cantharella/utils
Author: acheype Date: 2013-02-20 06:22:45 +0100 (Wed, 20 Feb 2013) New Revision: 135 Url: http://forge.codelutin.com/projects/cantharella/repository/revisions/135 Log: Resolve the problem of "[unchecked] Possible heap pollution from parameterized vararg type T" with the annotation @SafeVarargs Cf. http://docs.oracle.com/javase/7/docs/technotes/guides/language/non-reifiable... Modified: trunk/cantharella.data/ trunk/cantharella.service/ trunk/cantharella.utils/ trunk/cantharella.utils/src/main/java/nc/ird/cantharella/utils/AssertTools.java trunk/cantharella.utils/src/main/java/nc/ird/cantharella/utils/BeanTools.java Property changes on: trunk/cantharella.data ___________________________________________________________________ Modified: svn:ignore - target *.ipr *.iws *.iml .idea .classpath .project .apt_generated .settings + *.ipr nb-configuration.xml .classpath *.iws .project .idea *.iml target .apt_generated .settings Property changes on: trunk/cantharella.service ___________________________________________________________________ Modified: svn:ignore - target *.ipr *.iws *.iml .idea .classpath .project .apt_generated .settings + *.ipr nb-configuration.xml .classpath *.iws .project .idea *.iml target .apt_generated .settings Property changes on: trunk/cantharella.utils ___________________________________________________________________ Modified: svn:ignore - target *.ipr *.iws *.iml .idea .classpath .project .settings + *.ipr nb-configuration.xml .classpath *.iws .project .idea *.iml target .settings Modified: trunk/cantharella.utils/src/main/java/nc/ird/cantharella/utils/AssertTools.java =================================================================== --- trunk/cantharella.utils/src/main/java/nc/ird/cantharella/utils/AssertTools.java 2013-02-19 17:45:15 UTC (rev 134) +++ trunk/cantharella.utils/src/main/java/nc/ird/cantharella/utils/AssertTools.java 2013-02-20 05:22:45 UTC (rev 135) @@ -154,6 +154,7 @@ * @param object Object * @param values Values array */ + @SafeVarargs public static <O> void assertIn(O object, O... values) { assertNotEmpty(values); assertIn(object, Arrays.asList(values)); Modified: trunk/cantharella.utils/src/main/java/nc/ird/cantharella/utils/BeanTools.java =================================================================== --- trunk/cantharella.utils/src/main/java/nc/ird/cantharella/utils/BeanTools.java 2013-02-19 17:45:15 UTC (rev 134) +++ trunk/cantharella.utils/src/main/java/nc/ird/cantharella/utils/BeanTools.java 2013-02-20 05:22:45 UTC (rev 135) @@ -159,6 +159,7 @@ * @return First annotated public field * @throws NoSuchFieldException If an annotation cannot be found */ + @SafeVarargs public static Field getAnnotatedPublicField(Object thiz, Class<? extends Annotation>... annotations) throws NoSuchFieldException { AssertTools.assertNotNull(thiz); @@ -172,6 +173,7 @@ * @return First annotated field finded * @throws NoSuchFieldException If an annotation cannot be found */ + @SafeVarargs public static Field getAnnotatedPrivateField(Class<?> clazz, Class<? extends Annotation>... annotations) throws NoSuchFieldException { AssertTools.assertNotNull(clazz); @@ -209,6 +211,7 @@ * @return First annotated field finded * @throws NoSuchFieldException If an annotation cannot be found */ + @SafeVarargs private static Field getAnnotatedInheritedField(Class<?> baseClazz, Class<?> browsedClazz, Class<? extends Annotation>... annotations) throws NoSuchFieldException { AssertTools.assertNotNull(baseClazz); @@ -250,6 +253,7 @@ * @return First annotated public field * @throws NoSuchFieldException If an annotation cannot be found */ + @SafeVarargs public static Field getAnnotatedPublicField(Class<?> clazz, Class<? extends Annotation>... annotations) throws NoSuchFieldException { AssertTools.assertNotNull(clazz);
participants (1)
-
acheype@users.forge.codelutin.com