You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2018/02/21 15:36:32 UTC

[isis] 04/11: ISIS-1867: refactors MemberExecutionDtoUtils #jaxbContextFor so handles exception, same as JaxbUtil

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

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

commit bf1daf67959f830f3f7ca58243da81ee00a0f6d7
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Wed Feb 21 14:58:22 2018 +0000

    ISIS-1867: refactors MemberExecutionDtoUtils #jaxbContextFor so handles exception, same as JaxbUtil
---
 .../org/apache/isis/schema/utils/MemberExecutionDtoUtils.java     | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/core/applib/src/main/java/org/apache/isis/schema/utils/MemberExecutionDtoUtils.java b/core/applib/src/main/java/org/apache/isis/schema/utils/MemberExecutionDtoUtils.java
index 5090d0e..86eccab 100644
--- a/core/applib/src/main/java/org/apache/isis/schema/utils/MemberExecutionDtoUtils.java
+++ b/core/applib/src/main/java/org/apache/isis/schema/utils/MemberExecutionDtoUtils.java
@@ -73,10 +73,14 @@ public final class MemberExecutionDtoUtils {
 
     private static Map<Class<?>, JAXBContext> jaxbContextByClass = new MapMaker().concurrencyLevel(10).makeMap();
 
-    private static <T> JAXBContext jaxbContextFor(final Class<T> dtoClass) throws JAXBException {
+    private static <T> JAXBContext jaxbContextFor(final Class<T> dtoClass)  {
         JAXBContext jaxbContext = jaxbContextByClass.get(dtoClass);
         if(jaxbContext == null) {
-            jaxbContext = JAXBContext.newInstance(dtoClass);
+            try {
+                jaxbContext = JAXBContext.newInstance(dtoClass);
+            } catch (JAXBException e) {
+                throw new RuntimeException(e);
+            }
             jaxbContextByClass.put(dtoClass, jaxbContext);
         }
         return jaxbContext;

-- 
To stop receiving notification emails like this one, please contact
danhaywood@apache.org.