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

Fixing squid:S1481 - Unused local variables should be removed #609

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ public CompositeEntityMapper(Class<T> clazz, Integer ttl, ByteBuffer prefix) {

Field[] declaredFields = clazz.getDeclaredFields();
FieldMapper tempIdMapper = null;
CompositeColumnEntityMapper tempEmbeddedEntityMapper = null;
for (Field field : declaredFields) {
// Should only have one id field and it should map to the row key
Id idAnnotation = field.getAnnotation(Id.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ public ObjectMetadata call() throws Exception {

final AtomicReference<Exception> exception = new AtomicReference<Exception>();
final AtomicLong totalBytesRead = new AtomicLong();
final AtomicLong totalBytesRead2 = new AtomicLong();

// Iterate sequentially building up the batches. Once a complete
// batch of ids is ready
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,7 @@ public static void createKeyspace() throws Exception {
// ...
//

MutationBatch m;
OperationResult<Void> result;
m = keyspace.prepareMutationBatch();
MutationBatch m = keyspace.prepareMutationBatch();

for (char keyName = 'A'; keyName <= 'Z'; keyName++) {
String rowKey = Character.toString(keyName);
Expand All @@ -274,8 +272,6 @@ public static void createKeyspace() throws Exception {
.putColumn("Prefix1_b", 2, null)
.putColumn("prefix2_a", 3, null);

result = m.execute();

m.execute();

m = keyspace.prepareMutationBatch();
Expand Down Expand Up @@ -308,7 +304,7 @@ public void testMultiRowUniqueness() {
.withRow(CF_EMAIL_UNIQUE_UUID, "user1@domain.com");

try {
Column<UUID> c = constraint.getUniqueColumn();
constraint.getUniqueColumn();
Assert.fail();
}
catch (Exception e) {
Expand Down Expand Up @@ -693,7 +689,7 @@ public void testRowUniquenessConstraint() throws Exception {
}

try {
String data = unique.readDataAsString();
unique.readDataAsString();
Assert.fail();
}
catch (Exception e) {
Expand Down Expand Up @@ -1039,7 +1035,7 @@ public Boolean apply(Row<String, String> row) {
Future<Boolean> future = Executors.newSingleThreadExecutor().submit(reader);

try {
boolean result = future.get();
future.get();
Assert.fail();
}
catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,7 @@ public static void createKeyspace() throws Exception {
// ...
//

MutationBatch m;
OperationResult<Void> result;
m = keyspace.prepareMutationBatch();
MutationBatch m = keyspace.prepareMutationBatch();

for (char keyName = 'A'; keyName <= 'Z'; keyName++) {
String rowKey = Character.toString(keyName);
Expand All @@ -404,15 +402,15 @@ public static void createKeyspace() throws Exception {
.putColumn("Prefix1_b", 2, null)
.putColumn("prefix2_a", 3, null);

result = m.execute();
m.execute();

String rowKey = "A";
ColumnListMutation<Long> cfmLong = m.withRow(CF_LONGCOLUMN, rowKey);
for (Long l = -10L; l < 10L; l++) {
cfmLong.putEmptyColumn(l, null);
}
cfmLong.putEmptyColumn(Long.MAX_VALUE, null);
result = m.execute();
m.execute();

m.withRow(CF_USER_INFO, "acct1234")
.putColumn("firstname", "john", null)
Expand Down