Skip to content

Commit 30a2529

Browse files
committed
Going through and fixing some code analysis warnings. This improves some access scoping. Also removed Main.java
1 parent 4ee7ebc commit 30a2529

File tree

7 files changed

+12
-49
lines changed

7 files changed

+12
-49
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package com.spectralogic.ds3client;
22

33
public enum HttpVerb {
4-
GET,PUT,DELETE,HEAD,POST;
4+
GET,PUT,DELETE,HEAD,POST
55
}

src/main/java/com/spectralogic/ds3client/Main.java

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/main/java/com/spectralogic/ds3client/commands/AbstractResponse.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,23 @@
1212
import com.spectralogic.ds3client.serializer.XmlOutput;
1313
import com.spectralogic.ds3client.models.Error;
1414

15-
public abstract class AbstractResponse implements Closeable {
16-
final static protected String UTF8 = "UTF-8";
17-
final CloseableHttpResponse response;
15+
abstract class AbstractResponse implements Closeable {
16+
final static String UTF8 = "UTF-8";
1817

19-
public AbstractResponse(final CloseableHttpResponse response) throws IOException {
18+
final private CloseableHttpResponse response;
19+
20+
AbstractResponse(final CloseableHttpResponse response) throws IOException {
2021
this.response = response;
2122
processResponse();
2223
}
2324

2425
protected abstract void processResponse() throws IOException;
2526

26-
protected CloseableHttpResponse getResponse() {
27+
CloseableHttpResponse getResponse() {
2728
return response;
2829
}
2930

30-
protected void checkStatusCode(final int expectedStatus) throws IOException {
31+
void checkStatusCode(final int expectedStatus) throws IOException {
3132
final int statusCode = response.getStatusLine().getStatusCode();
3233
if (statusCode != expectedStatus) {
3334
final String responseString = readResponseString();

src/main/java/com/spectralogic/ds3client/commands/BulkRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import java.util.List;
1212

1313

14-
public abstract class BulkRequest extends AbstractRequest {
14+
abstract class BulkRequest extends AbstractRequest {
1515

1616
private final String bucket;
1717
private final List<Ds3Object> ds3Objects;

src/main/java/com/spectralogic/ds3client/models/Contents.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ public void setSize(final int size) {
6666
}
6767

6868
public String toString() {
69-
final StringBuilder builder = new StringBuilder();
70-
builder.append("{{key:: ").append(key).append("}, ");
71-
builder.append("{size:: ").append(size).append("}, ");
72-
builder.append("{owner:: ").append(owner).append("}}");
73-
return builder.toString();
69+
return "{{key:: " + key + "}, " + "{size:: " + size + "}, " + "{owner:: " + owner + "}}";
7470
}
7571
}

src/main/java/com/spectralogic/ds3client/models/ListBucketResult.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,7 @@ public void setContentsList(final List<Contents> contentsList) {
7777
}
7878

7979
public String toString() {
80-
final StringBuilder builder = new StringBuilder();
81-
builder.append("{{bucket:: ").append(name).append("},\n");
82-
builder.append("{numKeys:: ").append(maxKeys).append("},\n");
83-
builder.append("{objects:: ").append(contentsList).append("}}");
84-
return builder.toString();
80+
return "{{bucket:: " + name + "},\n" + "{numKeys:: " + maxKeys + "},\n" + "{objects:: " + contentsList + "}}";
8581
}
8682

8783
public String getCreationDate() {

src/main/java/com/spectralogic/ds3client/serializer/XmlOutput.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ public static String toXml(final Objects objects, final BulkCommand command) thr
5151
}
5252

5353
public static<T> T fromXml(final String xmlString, final Class<T> type) throws IOException {
54-
final T rootElement = mapper.readValue(xmlString, type);
55-
return rootElement;
54+
return mapper.readValue(xmlString, type);
5655
}
5756
}

0 commit comments

Comments
 (0)