You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2020/10/08 13:22:09 UTC

[isis] branch master updated (7a5803e -> e8452bd)

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git.


    from 7a5803e  ISIS-2445: remove pdn file, that prevents mvn. res. plugin update (not used)
     new fd8c35b  ISIS-2297: Double Brace Initialization should not be used (sonar)
     new e8452bd  ISIS-2297: throw IllegalState if no WebApplicationContext (sonar)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../jaxrsclient/impl/client/JaxRsClientDefault.java     | 17 ++++++++---------
 .../auth/AuthenticationSessionStrategyAbstract.java     |  4 ++++
 2 files changed, 12 insertions(+), 9 deletions(-)


[isis] 01/02: ISIS-2297: Double Brace Initialization should not be used (sonar)

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git

commit fd8c35bbdacd52b667d6caed8e78eefd83821040
Author: Andi Huber <ah...@apache.org>
AuthorDate: Thu Oct 8 15:15:50 2020 +0200

    ISIS-2297: Double Brace Initialization should not be used (sonar)
---
 .../jaxrsclient/impl/client/JaxRsClientDefault.java     | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/mappings/jaxrsclient/impl/src/main/java/org/apache/isis/extensions/jaxrsclient/impl/client/JaxRsClientDefault.java b/mappings/jaxrsclient/impl/src/main/java/org/apache/isis/extensions/jaxrsclient/impl/client/JaxRsClientDefault.java
index 75bcb08..548dee1 100644
--- a/mappings/jaxrsclient/impl/src/main/java/org/apache/isis/extensions/jaxrsclient/impl/client/JaxRsClientDefault.java
+++ b/mappings/jaxrsclient/impl/src/main/java/org/apache/isis/extensions/jaxrsclient/impl/client/JaxRsClientDefault.java
@@ -32,8 +32,7 @@ import javax.ws.rs.core.Response;
 import org.apache.isis.extensions.jaxrsclient.applib.client.JaxRsClient;
 import org.apache.isis.extensions.jaxrsclient.applib.client.JaxRsResponse;
 
-import lombok.Getter;
-import lombok.Setter;
+import lombok.val;
 
 public class JaxRsClientDefault implements JaxRsClient {
 
@@ -124,15 +123,15 @@ public class JaxRsClientDefault implements JaxRsClient {
     }
 
     private MediaType mediaTypeFor(final Class<?> dtoClass, final String reprType) {
-        // application/xml;profile="urn~org.restfulobjects~repr-types/action-result";x-ro-domain-type="org.apache.isis.schema.cmd.v1.CommandsDto"
-        return new MediaType("application", "xml",
-                new HashMap<String,String>() {{
-                    put("profile", "urn:org.restfulobjects:repr-types/" + reprType);
-                    put("x-ro-domain-type", dtoClass.getName());
-                }});
+        
+     // application/xml;profile="urn~org.restfulobjects~repr-types/action-result";x-ro-domain-type="org.apache.isis.schema.cmd.v1.CommandsDto"
+        val parameters = new HashMap<String,String>();
+        parameters.put("profile", "urn:org.restfulobjects:repr-types/" + reprType);
+        parameters.put("x-ro-domain-type", dtoClass.getName());
+        
+        return new MediaType("application", "xml", parameters);
     }
 
-
     private static String encode(final String username, final String password) {
         return org.apache.cxf.common.util.Base64Utility.encode(asBytes(username, password));
     }


[isis] 02/02: ISIS-2297: throw IllegalState if no WebApplicationContext (sonar)

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git

commit e8452bd8cebeb4671d0aafe6a034569c2a488fd9
Author: Andi Huber <ah...@apache.org>
AuthorDate: Thu Oct 8 15:21:57 2020 +0200

    ISIS-2297: throw IllegalState if no WebApplicationContext (sonar)
---
 .../viewer/webmodule/auth/AuthenticationSessionStrategyAbstract.java  | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/viewers/restfulobjects/viewer/src/main/java/org/apache/isis/viewer/restfulobjects/viewer/webmodule/auth/AuthenticationSessionStrategyAbstract.java b/viewers/restfulobjects/viewer/src/main/java/org/apache/isis/viewer/restfulobjects/viewer/webmodule/auth/AuthenticationSessionStrategyAbstract.java
index c6c8319..363a066 100644
--- a/viewers/restfulobjects/viewer/src/main/java/org/apache/isis/viewer/restfulobjects/viewer/webmodule/auth/AuthenticationSessionStrategyAbstract.java
+++ b/viewers/restfulobjects/viewer/src/main/java/org/apache/isis/viewer/restfulobjects/viewer/webmodule/auth/AuthenticationSessionStrategyAbstract.java
@@ -26,6 +26,7 @@ import javax.servlet.http.HttpSession;
 
 import org.springframework.web.context.support.WebApplicationContextUtils;
 
+import org.apache.isis.commons.internal.exceptions._Exceptions;
 import org.apache.isis.core.security.authentication.manager.AuthenticationManager;
 
 import lombok.val;
@@ -40,6 +41,9 @@ public abstract class AuthenticationSessionStrategyAbstract implements Authentic
         if(authenticationManager==null) {
             val servletContext = getServletContext(servletRequest);
             val webApplicationContext = WebApplicationContextUtils.getWebApplicationContext(servletContext);
+            if(webApplicationContext==null) {
+                throw _Exceptions.illegalState("Requires a WebApplicationContext (Spring).");
+            }
             authenticationManager = webApplicationContext.getBean(AuthenticationManager.class);
         }
         return authenticationManager;