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:30:38 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes 95743fcfc -> 48a8a1511


[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/48a8a151
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/48a8a151
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/48a8a151

Branch: refs/heads/2.7.x-fixes
Commit: 48a8a1511294da9ff8d0e7827be40cd442b66a82
Parents: 95743fc
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:30:18 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/48a8a151/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