cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject git commit: [CXF-5876] Updating AtomPojoProvider to log the warning only if the actual context injection failed
Date Mon, 14 Jul 2014 11:29:22 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 98340f1b5 -> 51925d81e


[CXF-5876] Updating AtomPojoProvider to log the warning only if the actual context injection
failed


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/51925d81
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/51925d81
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/51925d81

Branch: refs/heads/master
Commit: 51925d81e8ce5c4b13a94a03f94e59bb32412ab4
Parents: 98340f1
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Mon Jul 14 12:29:02 2014 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Mon Jul 14 12:29:02 2014 +0100

----------------------------------------------------------------------
 .../org/apache/cxf/jaxrs/provider/atom/AtomPojoProvider.java | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/51925d81/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/atom/AtomPojoProvider.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/atom/AtomPojoProvider.java
b/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/atom/AtomPojoProvider.java
index eb33b70..4e670f6 100644
--- a/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/atom/AtomPojoProvider.java
+++ b/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/atom/AtomPojoProvider.java
@@ -125,9 +125,13 @@ public class AtomPojoProvider extends AbstractConfigurableProvider
     }
     
     protected void tryInjectMessageContext(Object handler) {
+        Method m = null;
+        try {
+            m = handler.getClass().getMethod("setMessageContext", new Class[]{MessageContext.class});
+        } catch (Throwable t) {
+            return;
+        }
         try {
-            Method m = handler.getClass().getMethod("setMessageContext",
-                                                    new Class[]{MessageContext.class});
             InjectionUtils.injectThroughMethod(handler, m, mc);
         } catch (Throwable t) {
             LOG.warning("Message context can not be injected into " + handler.getClass().getName()



Mime
View raw message