avoided lazy initialization

revert-dabc3590
ayyoob 8 years ago
parent ed708852dc
commit 391cdbb435

@ -360,7 +360,7 @@ public class UIEventAdapter implements OutputEventAdapter {
// fetch the queryString Key:Value pair map of the given session. // fetch the queryString Key:Value pair map of the given session.
Map<String, String> queryParamValuePairs = webSocketSessionUtil.getQueryParamValuePairs(); Map<String, String> queryParamValuePairs = webSocketSessionUtil.getQueryParamValuePairs();
if (queryParamValuePairs != null) { if (queryParamValuePairs != null && !queryParamValuePairs.isEmpty()) {
// fetch the different attribute values received as part of the current event. // fetch the different attribute values received as part of the current event.
Object[] eventMetaData = event.getMetaData(); Object[] eventMetaData = event.getMetaData();
Object[] eventCorrelationData = event.getCorrelationData(); Object[] eventCorrelationData = event.getCorrelationData();

@ -1,17 +1,17 @@
/* /*
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. * in compliance with the License.
* you may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, * Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an * software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the * KIND, either express or implied. See the License for the
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
@ -35,7 +35,7 @@ public class WebSocketSessionRequest {
private static final String QUERY_STRING_SEPERATOR = "&"; private static final String QUERY_STRING_SEPERATOR = "&";
private static final String QUERY_KEY_VALUE_SEPERATOR = "="; private static final String QUERY_KEY_VALUE_SEPERATOR = "=";
private Map<String, String> queryParamValuePairs = null; private Map<String, String> queryParamValuePairs = new HashMap<>();
private Session session; private Session session;
public WebSocketSessionRequest(Session session) { public WebSocketSessionRequest(Session session) {
@ -65,9 +65,6 @@ public class WebSocketSessionRequest {
log.warn("Invalid query string [" + queryString + "] passed in."); log.warn("Invalid query string [" + queryString + "] passed in.");
break; break;
} }
if (queryParamValuePairs == null) {
queryParamValuePairs = new HashMap<>();
}
queryParamValuePairs.put(thisQueryParamPair[0], thisQueryParamPair[1]); queryParamValuePairs.put(thisQueryParamPair[0], thisQueryParamPair[1]);
} }
} }

Loading…
Cancel
Save