Skip to content
This repository was archived by the owner on May 28, 2018. It is now read-only.

Commit 3b1d813

Browse files
pavelbucekGerrit Code Review
authored andcommitted
Merge "Small simplification in OutboundEvent if clause."
2 parents 46e63ef + 976a2f1 commit 3b1d813

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

media/sse/src/main/java/org/glassfish/jersey/media/sse/OutboundEvent.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,8 @@ public Builder data(Object data) {
257257
* @throws IllegalStateException when called with invalid configuration (neither a comment nor event data are set).
258258
*/
259259
public OutboundEvent build() {
260-
if (comment == null) {
261-
if ((data == null) && (type == null)) {
262-
throw new IllegalStateException(LocalizationMessages.OUT_EVENT_NOT_BUILDABLE());
263-
}
260+
if (comment == null && data == null && type == null) {
261+
throw new IllegalStateException(LocalizationMessages.OUT_EVENT_NOT_BUILDABLE());
264262
}
265263

266264
return new OutboundEvent(name, id, reconnectDelay, type, mediaType, data, comment);

0 commit comments

Comments
 (0)