JSR-356 returning empty string (per javadoc) instead of null for Session.getNegotiatedSubprotocol()

This commit is contained in:
Joakim Erdfelt 2013-07-31 11:42:42 -07:00
parent 153c844238
commit 9846aee917
1 changed files with 6 additions and 1 deletions

View File

@ -254,7 +254,12 @@ public class JsrSession extends WebSocketSession implements javax.websocket.Sess
@Override
public String getNegotiatedSubprotocol()
{
return getUpgradeResponse().getAcceptedSubProtocol();
String acceptedSubProtocol = getUpgradeResponse().getAcceptedSubProtocol();
if (acceptedSubProtocol == null)
{
return "";
}
return acceptedSubProtocol;
}
@Override