cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject [1/2] cxf git commit: Finalizing applying the patch from Vjacheslav V. Borisov, This closes #172
Date Fri, 16 Sep 2016 10:28:52 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 9e8765ad4 -> 922152c21


Finalizing applying the patch from Vjacheslav V. Borisov, This closes #172


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

Branch: refs/heads/master
Commit: d6a70f57d6643c64cd87346f8233ff40cde36f5c
Parents: c184505
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Fri Sep 16 11:28:10 2016 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Fri Sep 16 11:28:10 2016 +0100

----------------------------------------------------------------------
 .../cxf/jaxrs/validation/ValidationExceptionMapper.java      | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/d6a70f57/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/validation/ValidationExceptionMapper.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/validation/ValidationExceptionMapper.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/validation/ValidationExceptionMapper.java
index b0d0938..146d105 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/validation/ValidationExceptionMapper.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/validation/ValidationExceptionMapper.java
@@ -60,7 +60,7 @@ public class ValidationExceptionMapper implements ExceptionMapper< ValidationExc
             }
             ResponseBuilder rb = JAXRSUtils.toResponseBuilder(errorStatus);
             if (responseBody != null) {
-                rb.entity(responseBody);
+                rb.entity(responseBody.toString());
             }
             return rb.build();
         } else {
@@ -68,8 +68,10 @@ public class ValidationExceptionMapper implements ExceptionMapper< ValidationExc
         }
     }
     private String getMessage(ConstraintViolation<?> violation) {
-        return violation.getRootBeanClass().getSimpleName() 
-            + "." + violation.getPropertyPath() 
+        return "Value " 
+            + (violation.getInvalidValue() != null ? "'" + violation.getInvalidValue().toString()
+ "'" : "(null)")
+            + " of " + violation.getRootBeanClass().getSimpleName()
+            + "." + violation.getPropertyPath()
             + ": " + violation.getMessage();
     }
     /**


Mime
View raw message