cxf-dev mailing list archives

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

    https://github.com/apache/cxf/pull/301#discussion_r131021447
  
    --- Diff: rt/rs/sse/src/main/java/org/apache/cxf/jaxrs/sse/OutboundSseEventImpl.java ---
    @@ -24,24 +24,24 @@
     import javax.ws.rs.core.MediaType;
     import javax.ws.rs.sse.OutboundSseEvent;
     
    -public class OutboundSseEventImpl implements OutboundSseEvent {
    -    private String id;
    -    private String name;
    -    private String comment;
    -    private long reconnectDelay = -1;
    -    private Class<?> type;
    -    private Type genericType;
    -    private MediaType mediaType;
    -    private Object data;
    +public final class OutboundSseEventImpl implements OutboundSseEvent {
    +    private final String id;
    +    private final String name;
    +    private final String comment;
    +    private final long reconnectDelay;
    +    private final Class<?> type;
    +    private final Type genericType;
    +    private final MediaType mediaType;
    +    private final Object data;
     
         public static class BuilderImpl implements Builder {
             private String id;
             private String name;
             private String comment;
             private long reconnectDelay = -1;
    -        private Class<?> type;
    +        private Class<?> type = String.class;
             private Type genericType;
    -        private MediaType mediaType;
    +        private MediaType mediaType = MediaType.SERVER_SENT_EVENTS_TYPE;
    --- End diff --
    
    Agree, if we need to pick the default, `text/plain` would be the best one I think. Not
sure about trying to determine if `application/json` should be used, I think the application
developer should signal that, much like with `@Produces` annotation.


---
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