You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ma...@apache.org on 2014/09/14 07:01:24 UTC

[06/15] git commit: Narrow scope of warning suppression.

Narrow scope of warning suppression.


Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/d1766fcb
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/d1766fcb
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/d1766fcb

Branch: refs/heads/master
Commit: d1766fcb1325c299fe3193c6c8c93cf601c36af8
Parents: 2f4a72c
Author: Matt Sicker <ma...@apache.org>
Authored: Sat Sep 13 18:31:00 2014 -0500
Committer: Matt Sicker <ma...@apache.org>
Committed: Sat Sep 13 18:31:00 2014 -0500

----------------------------------------------------------------------
 .../logging/log4j/core/config/plugins/visitors/PluginVisitors.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d1766fcb/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/visitors/PluginVisitors.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/visitors/PluginVisitors.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/visitors/PluginVisitors.java
index 4203442..1392c60 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/visitors/PluginVisitors.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/visitors/PluginVisitors.java
@@ -42,13 +42,13 @@ public final class PluginVisitors {
      * @param <A>        the Plugin annotation type.
      * @return a PluginVisitor instance if one could be created, or {@code null} otherwise.
      */
-    @SuppressWarnings("unchecked") // we're keeping track of types, thanks
     public static <A extends Annotation> PluginVisitor<A> findVisitor(final Class<A> annotation) {
         final PluginVisitorStrategy strategy = annotation.getAnnotation(PluginVisitorStrategy.class);
         if (strategy == null) {
             LOGGER.debug("No PluginVisitorStrategy found on annotation [{}]. Ignoring.", annotation);
             return null;
         }
+        @SuppressWarnings("unchecked")
         final Class<? extends PluginVisitor<A>> visitorClass = (Class<? extends PluginVisitor<A>>) strategy.value();
         try {
             return visitorClass.newInstance();