-
Notifications
You must be signed in to change notification settings - Fork 294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor code simplifications #185
base: master
Are you sure you want to change the base?
Conversation
@@ -58,7 +58,6 @@ | |||
private OkHostnameVerifier() { | |||
} | |||
|
|||
@Override |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To ensure compatibility with Java 1.5 (@Override
is not allowed for implementations of interface methods).
@@ -1199,15 +1198,17 @@ else if (frame.isContinuationFrame() == false) | |||
|
|||
// Generate the first frame using the existing WebSocketFrame instance. | |||
// Note that the reserved bit 1 and the opcode are untouched. | |||
byte[] payload = Arrays.copyOf(originalPayload, maxPayloadSize); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arrays.copyOf()
is not available in Java 1.5 that is targeted by this library.
frame.setFin(false).setPayload(payload); | ||
frames.add(frame); | ||
|
||
for (int from = maxPayloadSize; from < originalPayload.length; from += maxPayloadSize) | ||
{ | ||
// Prepare the payload of the next continuation frame. | ||
int to = Math.min(from + maxPayloadSize, originalPayload.length); | ||
payload = Arrays.copyOfRange(originalPayload, from, to); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arrays.copyOfRange()
is not available in Java 1.5 that is targeted by this library.
"[%s] Bad code length '%d' at the bit index '%d'.", | ||
DeflateUtil.class.getSimpleName(), codeLength, bitIndex); | ||
"[%s] Bad code length '%d' at the bit index '%s'.", | ||
DeflateUtil.class.getSimpleName(), codeLength, Arrays.toString(bitIndex)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exception at runtime possible otherwise.
No description provided.