Skip to content

Commit

Permalink
findbugs fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
delchev committed Nov 27, 2017
1 parent 84369fa commit f663f5e
Show file tree
Hide file tree
Showing 17 changed files with 134 additions and 89 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import java.util.Collection;
import java.util.List;

// TODO: Auto-generated Javadoc
/**
* The Class HttpClientRequestOptions.
*/
Expand All @@ -26,46 +25,46 @@ public class HttpClientRequestOptions {

/** The expect continue enabled. */
private boolean expectContinueEnabled;

/** The proxy host. */
private String proxyHost;

/** The proxy port. */
private int proxyPort;

/** The cookie spec. */
private String cookieSpec;

/** The redirects enabled. */
private boolean redirectsEnabled;

/** The relative redirects allowed. */
private boolean relativeRedirectsAllowed;

/** The circular redirects allowed. */
private boolean circularRedirectsAllowed;

/** The max redirects. */
private int maxRedirects;

/** The authentication enabled. */
private boolean authenticationEnabled;

/** The target preferred auth schemes. */
private Collection<String> targetPreferredAuthSchemes;

/** The proxy preferred auth schemes. */
private Collection<String> proxyPreferredAuthSchemes;

/** The connection request timeout. */
private int connectionRequestTimeout;

/** The connect timeout. */
private int connectTimeout;

/** The socket timeout. */
private int socketTimeout;

/** The content compression enabled. */
private boolean contentCompressionEnabled;

Expand All @@ -75,31 +74,31 @@ public class HttpClientRequestOptions {
/** The data. */
// binary content for POST and PUT
private byte[] data;

/** The text. */
// text content for POST and PUT
private String text;

/** The files. */
// file content for POST and PUT
private String[] files;

/** The character encoding. */
// encoding for POST
private String characterEncoding = StandardCharsets.UTF_8.name();

/** The content type. */
// content type for POST
private String contentType = "text/plain";

/** The headers. */
// headers
private List<HttpClientHeader> headers = new ArrayList<HttpClientHeader>();

/** The params. */
// params
private List<HttpClientParam> params = new ArrayList<HttpClientParam>();

/** The binary. */
// whether to request as binary or text
private boolean binary;
Expand All @@ -116,7 +115,8 @@ public boolean isExpectContinueEnabled() {
/**
* Sets the expect continue enabled.
*
* @param expectContinueEnabled the new expect continue enabled
* @param expectContinueEnabled
* the new expect continue enabled
*/
public void setExpectContinueEnabled(boolean expectContinueEnabled) {
this.expectContinueEnabled = expectContinueEnabled;
Expand All @@ -134,7 +134,8 @@ public String getProxyHost() {
/**
* Sets the proxy host.
*
* @param proxyHost the new proxy host
* @param proxyHost
* the new proxy host
*/
public void setProxyHost(String proxyHost) {
this.proxyHost = proxyHost;
Expand All @@ -152,7 +153,8 @@ public int getProxyPort() {
/**
* Sets the proxy port.
*
* @param proxyPort the new proxy port
* @param proxyPort
* the new proxy port
*/
public void setProxyPort(int proxyPort) {
this.proxyPort = proxyPort;
Expand All @@ -170,7 +172,8 @@ public String getCookieSpec() {
/**
* Sets the cookie spec.
*
* @param cookieSpec the new cookie spec
* @param cookieSpec
* the new cookie spec
*/
public void setCookieSpec(String cookieSpec) {
this.cookieSpec = cookieSpec;
Expand All @@ -188,7 +191,8 @@ public boolean isRedirectsEnabled() {
/**
* Sets the redirects enabled.
*
* @param redirectsEnabled the new redirects enabled
* @param redirectsEnabled
* the new redirects enabled
*/
public void setRedirectsEnabled(boolean redirectsEnabled) {
this.redirectsEnabled = redirectsEnabled;
Expand All @@ -206,7 +210,8 @@ public boolean isRelativeRedirectsAllowed() {
/**
* Sets the relative redirects allowed.
*
* @param relativeRedirectsAllowed the new relative redirects allowed
* @param relativeRedirectsAllowed
* the new relative redirects allowed
*/
public void setRelativeRedirectsAllowed(boolean relativeRedirectsAllowed) {
this.relativeRedirectsAllowed = relativeRedirectsAllowed;
Expand All @@ -224,7 +229,8 @@ public boolean isCircularRedirectsAllowed() {
/**
* Sets the circular redirects allowed.
*
* @param circularRedirectsAllowed the new circular redirects allowed
* @param circularRedirectsAllowed
* the new circular redirects allowed
*/
public void setCircularRedirectsAllowed(boolean circularRedirectsAllowed) {
this.circularRedirectsAllowed = circularRedirectsAllowed;
Expand All @@ -242,7 +248,8 @@ public int getMaxRedirects() {
/**
* Sets the max redirects.
*
* @param maxRedirects the new max redirects
* @param maxRedirects
* the new max redirects
*/
public void setMaxRedirects(int maxRedirects) {
this.maxRedirects = maxRedirects;
Expand All @@ -260,7 +267,8 @@ public boolean isAuthenticationEnabled() {
/**
* Sets the authentication enabled.
*
* @param authenticationEnabled the new authentication enabled
* @param authenticationEnabled
* the new authentication enabled
*/
public void setAuthenticationEnabled(boolean authenticationEnabled) {
this.authenticationEnabled = authenticationEnabled;
Expand All @@ -278,7 +286,8 @@ public Collection<String> getTargetPreferredAuthSchemes() {
/**
* Sets the target preferred auth schemes.
*
* @param targetPreferredAuthSchemes the new target preferred auth schemes
* @param targetPreferredAuthSchemes
* the new target preferred auth schemes
*/
public void setTargetPreferredAuthSchemes(Collection<String> targetPreferredAuthSchemes) {
this.targetPreferredAuthSchemes = targetPreferredAuthSchemes;
Expand All @@ -296,7 +305,8 @@ public Collection<String> getProxyPreferredAuthSchemes() {
/**
* Sets the proxy preferred auth schemes.
*
* @param proxyPreferredAuthSchemes the new proxy preferred auth schemes
* @param proxyPreferredAuthSchemes
* the new proxy preferred auth schemes
*/
public void setProxyPreferredAuthSchemes(Collection<String> proxyPreferredAuthSchemes) {
this.proxyPreferredAuthSchemes = proxyPreferredAuthSchemes;
Expand All @@ -314,7 +324,8 @@ public int getConnectionRequestTimeout() {
/**
* Sets the connection request timeout.
*
* @param connectionRequestTimeout the new connection request timeout
* @param connectionRequestTimeout
* the new connection request timeout
*/
public void setConnectionRequestTimeout(int connectionRequestTimeout) {
this.connectionRequestTimeout = connectionRequestTimeout;
Expand All @@ -332,7 +343,8 @@ public int getConnectTimeout() {
/**
* Sets the connect timeout.
*
* @param connectTimeout the new connect timeout
* @param connectTimeout
* the new connect timeout
*/
public void setConnectTimeout(int connectTimeout) {
this.connectTimeout = connectTimeout;
Expand All @@ -350,7 +362,8 @@ public int getSocketTimeout() {
/**
* Sets the socket timeout.
*
* @param socketTimeout the new socket timeout
* @param socketTimeout
* the new socket timeout
*/
public void setSocketTimeout(int socketTimeout) {
this.socketTimeout = socketTimeout;
Expand All @@ -368,7 +381,8 @@ public boolean isContentCompressionEnabled() {
/**
* Sets the content compression enabled.
*
* @param contentCompressionEnabled the new content compression enabled
* @param contentCompressionEnabled
* the new content compression enabled
*/
public void setContentCompressionEnabled(boolean contentCompressionEnabled) {
this.contentCompressionEnabled = contentCompressionEnabled;
Expand All @@ -386,7 +400,8 @@ public boolean isSslTrustAllEnabled() {
/**
* Sets the ssl trust all enabled.
*
* @param sslTrustAllEnabled the new ssl trust all enabled
* @param sslTrustAllEnabled
* the new ssl trust all enabled
*/
public void setSslTrustAllEnabled(boolean sslTrustAllEnabled) {
this.sslTrustAllEnabled = sslTrustAllEnabled;
Expand All @@ -398,13 +413,14 @@ public void setSslTrustAllEnabled(boolean sslTrustAllEnabled) {
* @return the data
*/
public byte[] getData() {
return data;
return data.clone();
}

/**
* Sets the data.
*
* @param data the new data
* @param data
* the new data
*/
public void setData(byte[] data) {
this.data = data;
Expand All @@ -422,7 +438,8 @@ public String getText() {
/**
* Sets the text.
*
* @param text the new text
* @param text
* the new text
*/
public void setText(String text) {
this.text = text;
Expand All @@ -434,13 +451,14 @@ public void setText(String text) {
* @return the files
*/
public String[] getFiles() {
return files;
return files.clone();
}

/**
* Sets the files.
*
* @param files the new files
* @param files
* the new files
*/
public void setFiles(String[] files) {
this.files = files;
Expand All @@ -458,7 +476,8 @@ public String getCharacterEncoding() {
/**
* Sets the character encoding.
*
* @param characterEncoding the new character encoding
* @param characterEncoding
* the new character encoding
*/
public void setCharacterEncoding(String characterEncoding) {
this.characterEncoding = characterEncoding;
Expand All @@ -476,7 +495,8 @@ public String getContentType() {
/**
* Sets the content type.
*
* @param contentType the new content type
* @param contentType
* the new content type
*/
public void setContentType(String contentType) {
this.contentType = contentType;
Expand All @@ -494,7 +514,8 @@ public List<HttpClientHeader> getHeaders() {
/**
* Sets the headers.
*
* @param headers the new headers
* @param headers
* the new headers
*/
public void setHeaders(List<HttpClientHeader> headers) {
this.headers = headers;
Expand All @@ -512,7 +533,8 @@ public List<HttpClientParam> getParams() {
/**
* Sets the params.
*
* @param params the new params
* @param params
* the new params
*/
public void setParams(List<HttpClientParam> params) {
this.params = params;
Expand All @@ -530,7 +552,8 @@ public boolean isBinary() {
/**
* Sets the binary.
*
* @param binary the new binary
* @param binary
* the new binary
*/
public void setBinary(boolean binary) {
this.binary = binary;
Expand Down
Loading

0 comments on commit f663f5e

Please sign in to comment.