cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andymc12 <...@git.apache.org>
Subject [GitHub] cxf pull request #301: [CXF-7462] Minor improvements to OutboundSseEventImpl
Date Wed, 02 Aug 2017 16:29:27 GMT
Github user andymc12 commented on a diff in the pull request:

    https://github.com/apache/cxf/pull/301#discussion_r130927024
  
    --- Diff: rt/rs/sse/src/main/java/org/apache/cxf/jaxrs/sse/OutboundSseEventImpl.java ---
    @@ -92,6 +92,7 @@ public Builder data(GenericType newType, Object newData) {
     
             @Override
             public Builder data(Object newData) {
    +            this.type = newData.getClass();
    --- End diff --
    
    Good catch!  Do you have any thoughts on what we should do if a null is passed in?  The
spec throws an `IllegalArgumentException` if the user passes null to `sse.newEvent(String
data)`.  For `builder.data(null)`, we could either do the same, or take null as the data and
use Object.class as the default type.  I'm leaning toward throwing the exception.  What do
you think?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message