-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update pom.xml to include spotbugs * Update pom.xml to generate site. * Using static secure random. * Specify character sets for Base64 and create issues for others. * Adding spotbugs excludes. * Make variables static. * Consolidate unused locals and switch-case. * Add exclude for being explicit about payload length cases. * Moving named anonymous class to named class. * Removing unused private methods. * Use Locale.ROOT for encoding. * Making inner class final and private constructor. * Creating Utils class to house secure random. * Adding comment for spotbugs. * Add javadoc parameters to test. * Use secure random instead of Math.random() * Alphabetise.
- Loading branch information
Showing
13 changed files
with
228 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<FindBugsFilter> | ||
<!-- This was written a while ago and the byte shifts work for outputting the data. --> | ||
<Match> | ||
<Class name="com.microsoft.azure.proton.transport.ws.impl.WebSocketHandlerImpl"/> | ||
<Method name="wrapBuffer"/> | ||
<Bug pattern="ICAST_BAD_SHIFT_AMOUNT"/> | ||
</Match> | ||
|
||
<!-- We want to be explicit about the WebSocket payload length because the RFC specifies these ranges. --> | ||
<Match> | ||
<Class name="com.microsoft.azure.proton.transport.ws.impl.WebSocketHandlerImpl"/> | ||
<Method name="unwrapBuffer"/> | ||
<Bug pattern="UC_USELESS_CONDITION"/> | ||
</Match> | ||
|
||
<!-- It is not needed to make this inner class into a static one. Requires more refactoring than needed. --> | ||
<Match> | ||
<Class name="com.microsoft.azure.proton.transport.ws.impl.WebSocketImpl$WebSocketSnifferTransportWrapper"/> | ||
<Bug pattern="SIC_INNER_SHOULD_BE_STATIC_NEEDS_THIS"/> | ||
</Match> | ||
|
||
<!-- TODO (conniey): https://github.com/Azure/qpid-proton-j-extensions/issues/42 --> | ||
<Match> | ||
<Class name="com.microsoft.azure.proton.transport.proxy.impl.ProxyImpl"/> | ||
<Method name="writeProxyRequest" /> | ||
<Bug pattern="DM_DEFAULT_ENCODING"/> | ||
</Match> | ||
|
||
<!-- TODO (conniey): https://github.com/Azure/qpid-proton-j-extensions/issues/43 --> | ||
<Match> | ||
<Class name="com.microsoft.azure.proton.transport.ws.impl.WebSocketImpl"/> | ||
<Method name="writeUpgradeRequest"/> | ||
<Bug pattern="DM_DEFAULT_ENCODING"/> | ||
</Match> | ||
</FindBugsFilter> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/main/java/com/microsoft/azure/proton/transport/ws/impl/Utils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.microsoft.azure.proton.transport.ws.impl; | ||
|
||
import java.security.SecureRandom; | ||
|
||
/** | ||
* Utility methods. | ||
*/ | ||
final class Utils { | ||
private static final SecureRandom SECURE_RANDOM = new SecureRandom(); | ||
|
||
/** | ||
* Gets an instance of secure random. | ||
* | ||
* @return An instance of secure random. | ||
*/ | ||
static SecureRandom getSecureRandom() { | ||
return SECURE_RANDOM; | ||
} | ||
|
||
/** | ||
* So an instance of class cannot be created. | ||
*/ | ||
private Utils() { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.