cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1484996 - in /cxf/branches/2.5.x-fixes: ./ rt/rs/security/cors/src/main/java/org/apache/cxf/rs/security/cors/CrossOriginResourceSharingFilter.java
Date Tue, 21 May 2013 22:05:30 GMT
Author: sergeyb
Date: Tue May 21 22:05:29 2013
New Revision: 1484996

URL: http://svn.apache.org/r1484996
Log:
Merged revisions 1484988 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.6.x-fixes

................
  r1484988 | sergeyb | 2013-05-21 22:55:29 +0100 (Tue, 21 May 2013) | 9 lines
  
  Merged revisions 1484982 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes
  
  ........
    r1484982 | sergeyb | 2013-05-21 22:50:00 +0100 (Tue, 21 May 2013) | 1 line
    
    Fixing CORS test on 2.7.x
  ........
................

Modified:
    cxf/branches/2.5.x-fixes/   (props changed)
    cxf/branches/2.5.x-fixes/rt/rs/security/cors/src/main/java/org/apache/cxf/rs/security/cors/CrossOriginResourceSharingFilter.java

Propchange: cxf/branches/2.5.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/branches/2.7.x-fixes:r1484982
  Merged /cxf/branches/2.6.x-fixes:r1484988

Propchange: cxf/branches/2.5.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.5.x-fixes/rt/rs/security/cors/src/main/java/org/apache/cxf/rs/security/cors/CrossOriginResourceSharingFilter.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/rs/security/cors/src/main/java/org/apache/cxf/rs/security/cors/CrossOriginResourceSharingFilter.java?rev=1484996&r1=1484995&r2=1484996&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/rs/security/cors/src/main/java/org/apache/cxf/rs/security/cors/CrossOriginResourceSharingFilter.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/rs/security/cors/src/main/java/org/apache/cxf/rs/security/cors/CrossOriginResourceSharingFilter.java
Tue May 21 22:05:29 2013
@@ -86,19 +86,19 @@ public class CrossOriginResourceSharingF
     private boolean defaultOptionsMethodsHandlePreflight;
     
     
-    private <T extends Annotation> T  getAnnotation(OperationResourceInfo ori,
+    private <T extends Annotation> T  getAnnotation(Method m,
                                                     Class<T> annClass) {
-        if (ori == null) {
+        if (m == null) {
             return null;
         }
         return ReflectionUtil.getAnnotationForMethodOrContainingClass(
-             ori.getAnnotatedMethod(),  annClass);
+             m,  annClass);
     }
 
     public Response handleRequest(Message m, ClassResourceInfo resourceClass) {
         OperationResourceInfo opResInfo = m.getExchange().get(OperationResourceInfo.class);
-        CrossOriginResourceSharing annotation = 
-            getAnnotation(opResInfo, CrossOriginResourceSharing.class);
+        CrossOriginResourceSharing annotation = opResInfo == null ? null 
+            : getAnnotation(opResInfo.getAnnotatedMethod(), CrossOriginResourceSharing.class);
         
         if ("OPTIONS".equals(m.get(Message.HTTP_REQUEST_METHOD))) {
             return preflightRequest(m, annotation, opResInfo, resourceClass);
@@ -165,8 +165,8 @@ public class CrossOriginResourceSharingF
          * has one of our annotations on it (or its parent class) indicating 'localPreflight'
--
          * or the defaultOptionsMethodsHandlePreflight flag is true.
          */
-        LocalPreflight preflightAnnotation = 
-            getAnnotation(opResInfo, LocalPreflight.class);
+        LocalPreflight preflightAnnotation = opResInfo == null ? null :  
+            getAnnotation(opResInfo.getAnnotatedMethod(), LocalPreflight.class);
         if (preflightAnnotation != null || defaultOptionsMethodsHandlePreflight) { 
             return null; // let the resource method take all responsibility.
         }
@@ -197,7 +197,7 @@ public class CrossOriginResourceSharingF
         if (method == null) {
             return null;
         }
-        CrossOriginResourceSharing ann = method.getAnnotation(CrossOriginResourceSharing.class);
+        CrossOriginResourceSharing ann = getAnnotation(method, CrossOriginResourceSharing.class);
         ann = ann == null ? corsAnn : ann;
         
         /* We aren't required to have any annotation at all. If no annotation,



Mime
View raw message