Skip to content

Commit

Permalink
Fix minor style errros
Browse files Browse the repository at this point in the history
  • Loading branch information
mziccard committed Apr 19, 2016
1 parent 357c779 commit 2995240
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public abstract class BatchResult<T, E extends BaseServiceException> {
private T result;
private boolean completed = false;
private E error;
private List<Callback<T, E>> toBeNotified = new LinkedList<>();
private final List<Callback<T, E>> toBeNotified = new LinkedList<>();

/**
* Returns {@code true} if the batch has been completed and the result is available; {@code false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
*/
public class DnsBatch {

private RpcBatch batch;
private final RpcBatch batch;
private final DnsRpc dnsRpc;
private final DnsOptions options;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ public Page<RecordSet> nextPage() {
static Function<ManagedZone, Zone> zoneFromPb(final DnsOptions options) {
return new Function<ManagedZone, Zone>() {
@Override
public Zone apply(
com.google.api.services.dns.model.ManagedZone zonePb) {
public Zone apply(ManagedZone zonePb) {
return Zone.fromPb(options.service(), zonePb);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class DefaultDnsRpc implements DnsRpc {

private class DefaultRpcBatch implements RpcBatch {

private BatchRequest batch;
private final BatchRequest batch;

private DefaultRpcBatch(BatchRequest batch) {
this.batch = batch;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import com.google.cloud.BaseServiceException;
import com.google.cloud.BatchResult;

import org.easymock.EasyMock;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public class DnsBatchTest {
private DnsRpc dnsRpcMock;
private RpcBatch batchMock;
private DnsBatch dnsBatch;
private Dns dns = EasyMock.createStrictMock(Dns.class);
private final Dns dns = EasyMock.createStrictMock(Dns.class);

@Before
public void setUp() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2378,12 +2378,11 @@ public void onSuccess(ChangesListResponse response) {
}, ImmutableMap.of(DnsRpc.Option.PAGE_SIZE, 2));
final Iterable<Change> descending = RPC.listChangeRequests(ZONE1.getName(),
ImmutableMap.of(DnsRpc.Option.SORTING_ORDER, "descending")).results();
final int size = 4;
batch.addListChangeRequests(ZONE_NAME1, new SuccessExpectedCallback<ChangesListResponse>() {
@Override
public void onSuccess(ChangesListResponse response) {
List<Change> changes = response.getChanges();
for (int i = 0; i < size; i++) {
for (int i = 0; i < 4; i++) {
assertEquals(Iterables.get(descending, i), changes.get(i));
}
}
Expand All @@ -2392,8 +2391,8 @@ public void onSuccess(ChangesListResponse response) {
@Override
public void onSuccess(ChangesListResponse response) {
List<Change> changes = response.getChanges();
for (int i = 0; i < size; i++) {
assertEquals(Iterables.get(descending, i), changes.get(size - i - 1));
for (int i = 0; i < 4; i++) {
assertEquals(Iterables.get(descending, i), changes.get(3 - i));
}
}
}, ImmutableMap.of(DnsRpc.Option.SORTING_ORDER, "ascending"));
Expand Down

0 comments on commit 2995240

Please sign in to comment.