cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-7264] Temporarily reverting an earlier patch
Date Fri, 10 Mar 2017 14:41:24 GMT
Repository: cxf
Updated Branches:
  refs/heads/master da68e9947 -> f22e465e5


[CXF-7264] Temporarily reverting an earlier patch


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

Branch: refs/heads/master
Commit: f22e465e5f34265f9e459c07ac3997de954b78a6
Parents: da68e99
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Fri Mar 10 14:41:09 2017 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Fri Mar 10 14:41:09 2017 +0000

----------------------------------------------------------------------
 .../oauth2/provider/JPAOAuthDataProvider.java         | 14 ++++++--------
 .../oauth2/provider/JPAOAuthDataProviderTest.java     |  2 ++
 2 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/f22e465e/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/JPAOAuthDataProvider.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/JPAOAuthDataProvider.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/JPAOAuthDataProvider.java
index 859e2b1..ce49673 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/JPAOAuthDataProvider.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/JPAOAuthDataProvider.java
@@ -263,14 +263,12 @@ public class JPAOAuthDataProvider extends AbstractOAuthDataProvider
{
                 }
                 serverToken.setScopes(perms);
 
-                if (serverToken.getSubject() != null) {
-                    UserSubject sub = em.find(UserSubject.class, serverToken.getSubject().getLogin());
-                    if (sub == null) {
-                        em.persist(serverToken.getSubject());
-                    } else {
-                        sub = serverToken.getSubject();
-                        serverToken.setSubject(sub);
-                    }
+                UserSubject sub = em.find(UserSubject.class, serverToken.getSubject().getLogin());
+                if (sub == null) {
+                    em.persist(serverToken.getSubject());
+                } else {
+                    sub = em.merge(serverToken.getSubject());
+                    serverToken.setSubject(sub);
                 }
                 // ensure we have a managed association
                 // (needed for OpenJPA : InvalidStateException: Encountered unmanaged object)

http://git-wip-us.apache.org/repos/asf/cxf/blob/f22e465e/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/provider/JPAOAuthDataProviderTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/provider/JPAOAuthDataProviderTest.java
b/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/provider/JPAOAuthDataProviderTest.java
index 25da9e2..b71a920 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/provider/JPAOAuthDataProviderTest.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/provider/JPAOAuthDataProviderTest.java
@@ -34,6 +34,7 @@ import org.apache.cxf.rs.security.oauth2.utils.OAuthConstants;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 
 public class JPAOAuthDataProviderTest extends Assert {
@@ -177,6 +178,7 @@ public class JPAOAuthDataProviderTest extends Assert {
     }
 
     @Test
+    @Ignore("uncomment when CXF-7264 is fixed")
     public void testAddGetDeleteAccessTokenWithNullSubject() {
         Client c = addClient("102", "bob");
 


Mime
View raw message