squid:S00117 - Local variable and method parameter names should comply with a naming convention.
This commit is contained in:
@@ -29,9 +29,9 @@ public class Emitter {
|
|||||||
ConcurrentLinkedQueue<Listener> callbacks = this.callbacks.get(event);
|
ConcurrentLinkedQueue<Listener> callbacks = this.callbacks.get(event);
|
||||||
if (callbacks == null) {
|
if (callbacks == null) {
|
||||||
callbacks = new ConcurrentLinkedQueue <Listener>();
|
callbacks = new ConcurrentLinkedQueue <Listener>();
|
||||||
ConcurrentLinkedQueue<Listener> _callbacks = this.callbacks.putIfAbsent(event, callbacks);
|
ConcurrentLinkedQueue<Listener> tempCallbacks = this.callbacks.putIfAbsent(event, callbacks);
|
||||||
if (_callbacks != null) {
|
if (tempCallbacks != null) {
|
||||||
callbacks = _callbacks;
|
callbacks = tempCallbacks;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
callbacks.add(fn);
|
callbacks.add(fn);
|
||||||
|
|||||||
@@ -19,13 +19,13 @@ public class HandshakeData {
|
|||||||
/*package*/ HandshakeData(JSONObject data) throws JSONException {
|
/*package*/ HandshakeData(JSONObject data) throws JSONException {
|
||||||
JSONArray upgrades = data.getJSONArray("upgrades");
|
JSONArray upgrades = data.getJSONArray("upgrades");
|
||||||
int length = upgrades.length();
|
int length = upgrades.length();
|
||||||
String[] _upgrades = new String[length];
|
String[] tempUpgrades = new String[length];
|
||||||
for (int i = 0; i < length; i ++) {
|
for (int i = 0; i < length; i ++) {
|
||||||
_upgrades[i] = upgrades.getString(i);
|
tempUpgrades[i] = upgrades.getString(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.sid = data.getString("sid");
|
this.sid = data.getString("sid");
|
||||||
this.upgrades = _upgrades;
|
this.upgrades = tempUpgrades;
|
||||||
this.pingInterval = data.getLong("pingInterval");
|
this.pingInterval = data.getLong("pingInterval");
|
||||||
this.pingTimeout = data.getLong("pingTimeout");
|
this.pingTimeout = data.getLong("pingTimeout");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,8 +128,8 @@ abstract public class Polling extends Transport {
|
|||||||
|
|
||||||
if (data instanceof String) {
|
if (data instanceof String) {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
Parser.DecodePayloadCallback<String> _callback = callback;
|
Parser.DecodePayloadCallback<String> tempCallback = callback;
|
||||||
Parser.decodePayload((String)data, _callback);
|
Parser.decodePayload((String)data, tempCallback);
|
||||||
} else if (data instanceof byte[]) {
|
} else if (data instanceof byte[]) {
|
||||||
Parser.decodePayload((byte[])data, callback);
|
Parser.decodePayload((byte[])data, callback);
|
||||||
}
|
}
|
||||||
@@ -203,19 +203,19 @@ abstract public class Polling extends Transport {
|
|||||||
query.put(this.timestampParam, Yeast.yeast());
|
query.put(this.timestampParam, Yeast.yeast());
|
||||||
}
|
}
|
||||||
|
|
||||||
String _query = ParseQS.encode(query);
|
String derivedQuery = ParseQS.encode(query);
|
||||||
|
|
||||||
if (this.port > 0 && (("https".equals(schema) && this.port != 443)
|
if (this.port > 0 && (("https".equals(schema) && this.port != 443)
|
||||||
|| ("http".equals(schema) && this.port != 80))) {
|
|| ("http".equals(schema) && this.port != 80))) {
|
||||||
port = ":" + this.port;
|
port = ":" + this.port;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_query.length() > 0) {
|
if (derivedQuery.length() > 0) {
|
||||||
_query = "?" + _query;
|
derivedQuery = "?" + derivedQuery;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean ipv6 = this.hostname.contains(":");
|
boolean ipv6 = this.hostname.contains(":");
|
||||||
return schema + "://" + (ipv6 ? "[" + this.hostname + "]" : this.hostname) + port + this.path + _query;
|
return schema + "://" + (ipv6 ? "[" + this.hostname + "]" : this.hostname) + port + this.path + derivedQuery;
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract protected void doWrite(byte[] data, Runnable fn);
|
abstract protected void doWrite(byte[] data, Runnable fn);
|
||||||
|
|||||||
@@ -281,9 +281,9 @@ public class PollingXHR extends Polling {
|
|||||||
int len = 0;
|
int len = 0;
|
||||||
byte[] buffer = new byte[1024];
|
byte[] buffer = new byte[1024];
|
||||||
while ((len = input.read(buffer)) > 0) {
|
while ((len = input.read(buffer)) > 0) {
|
||||||
byte[] _buffer = new byte[len];
|
byte[] tempBuffer = new byte[len];
|
||||||
System.arraycopy(buffer, 0, _buffer, 0, len);
|
System.arraycopy(buffer, 0, tempBuffer, 0, len);
|
||||||
buffers.add(_buffer);
|
buffers.add(tempBuffer);
|
||||||
capacity += len;
|
capacity += len;
|
||||||
}
|
}
|
||||||
ByteBuffer data = ByteBuffer.allocate(capacity);
|
ByteBuffer data = ByteBuffer.allocate(capacity);
|
||||||
|
|||||||
@@ -221,12 +221,12 @@ public class WebSocket extends Transport {
|
|||||||
query.put(this.timestampParam, Yeast.yeast());
|
query.put(this.timestampParam, Yeast.yeast());
|
||||||
}
|
}
|
||||||
|
|
||||||
String _query = ParseQS.encode(query);
|
String derivedQuery = ParseQS.encode(query);
|
||||||
if (_query.length() > 0) {
|
if (derivedQuery.length() > 0) {
|
||||||
_query = "?" + _query;
|
derivedQuery = "?" + derivedQuery;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean ipv6 = this.hostname.contains(":");
|
boolean ipv6 = this.hostname.contains(":");
|
||||||
return schema + "://" + (ipv6 ? "[" + this.hostname + "]" : this.hostname) + port + this.path + _query;
|
return schema + "://" + (ipv6 ? "[" + this.hostname + "]" : this.hostname) + port + this.path + derivedQuery;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -45,10 +45,10 @@ public class Parser {
|
|||||||
public static void encodePacket(Packet packet, boolean utf8encode, EncodeCallback callback) throws UTF8Exception {
|
public static void encodePacket(Packet packet, boolean utf8encode, EncodeCallback callback) throws UTF8Exception {
|
||||||
if (packet.data instanceof byte[]) {
|
if (packet.data instanceof byte[]) {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
Packet<byte[]> _packet = packet;
|
Packet<byte[]> packetToEncode = packet;
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
EncodeCallback<byte[]> _callback = callback;
|
EncodeCallback<byte[]> callbackToEncode = callback;
|
||||||
encodeByteArray(_packet, _callback);
|
encodeByteArray(packetToEncode, callbackToEncode);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,8 +59,8 @@ public class Parser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
EncodeCallback<String> _callback = callback;
|
EncodeCallback<String> tempCallback = callback;
|
||||||
_callback.call(encoded);
|
tempCallback.call(encoded);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void encodeByteArray(Packet<byte[]> packet, EncodeCallback<byte[]> callback) {
|
private static void encodeByteArray(Packet<byte[]> packet, EncodeCallback<byte[]> callback) {
|
||||||
@@ -219,8 +219,8 @@ public class Parser {
|
|||||||
}
|
}
|
||||||
if (numberTooLong) {
|
if (numberTooLong) {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
DecodePayloadCallback<String> _callback = callback;
|
DecodePayloadCallback<String> tempCallback = callback;
|
||||||
_callback.call(err, 0, 1);
|
tempCallback.call(err, 0, 1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
bufferTail.position(strLen.length() + 1);
|
bufferTail.position(strLen.length() + 1);
|
||||||
@@ -247,12 +247,12 @@ public class Parser {
|
|||||||
Object buffer = buffers.get(i);
|
Object buffer = buffers.get(i);
|
||||||
if (buffer instanceof String) {
|
if (buffer instanceof String) {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
DecodePayloadCallback<String> _callback = callback;
|
DecodePayloadCallback<String> tempCallback = callback;
|
||||||
_callback.call(decodePacket((String)buffer, true), i, total);
|
tempCallback.call(decodePacket((String)buffer, true), i, total);
|
||||||
} else if (buffer instanceof byte[]) {
|
} else if (buffer instanceof byte[]) {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
DecodePayloadCallback<byte[]> _callback = callback;
|
DecodePayloadCallback<byte[]> tempCallback = callback;
|
||||||
_callback.call(decodePacket((byte[])buffer), i, total);
|
tempCallback.call(decodePacket((byte[])buffer), i, total);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user