Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ovalseven8
Copy link

No description provided.

@@ -58,7 +58,6 @@
private OkHostnameVerifier() {
}

@Override
Copy link
Author

@ovalseven8 ovalseven8 Jun 18, 2019

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);
Copy link
Author

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);
Copy link
Author

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));
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant