File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed
Original file line numberDiff line numberDiff line change
@@ -237,22 +237,15 @@
237237
<dependency>
238238
<groupId>com.google.code.findbugs</groupId>
239239
<artifactId>jsr305</artifactId>
240-
<version>3.0.2</version>
241240
</dependency>
242241
<dependency>
243242
<groupId>com.google.code.gson</groupId>
244243
<artifactId>gson</artifactId>
245-
<version>2.8.6</version>
246244
</dependency>
247245
<dependency>
248246
<groupId>com.google.auth</groupId>
249247
<artifactId>google-auth-library-credentials</artifactId>
250248
</dependency>
251-
<dependency>
252-
<groupId>org.apache.commons</groupId>
253-
<artifactId>commons-lang3</artifactId>
254-
<version>3.5</version>
255-
</dependency>
256249

257250
<!-- Test dependencies -->
258251
<dependency>
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@
3434
import com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata;
3535
import java.util.ArrayList;
3636
import java.util.Arrays;
37+
import java.util.Collections;
3738
import java.util.HashSet;
3839
import java.util.List;
3940
import java.util.Set;
4041
import java.util.concurrent.Callable;
4142
import java.util.concurrent.ExecutionException;
42-
import org.apache.commons.lang3.ArrayUtils;
4343

4444
/**
4545
* {@link UnitOfWork} that is used when a DDL batch is started. These batches only accept DDL
@@ -124,7 +124,10 @@ public ResultSet executeQuery(
124124
// Queries marked with internal metadata queries are allowed during a DDL batch.
125125
// These can only be generated by library internal methods and may be used to check
126126
// whether a database object such as table or an index exists.
127-
final QueryOption[] internalOptions = ArrayUtils.remove(options, i);
127+
List<QueryOption> temp = new ArrayList<>();
128+
Collections.addAll(temp, options);
129+
temp.remove(i);
130+
final QueryOption[] internalOptions = temp.toArray(new QueryOption[0]);
128131
Callable<ResultSet> callable =
129132
new Callable<ResultSet>() {
130133
@Override
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,9 @@ public void testExecuteMetadataQuery() {
156156
when(singleUse.executeQuery(statement)).thenReturn(resultSet);
157157
when(dbClient.singleUse()).thenReturn(singleUse);
158158
DdlBatch batch = createSubject(createDefaultMockDdlClient(), dbClient);
159-
assertThat(
160-
batch
161-
.executeQuery(parsedStatement, AnalyzeMode.NONE, InternalMetadataQuery.INSTANCE)
162-
.hashCode(),
163-
is(equalTo(resultSet.hashCode())));
159+
ResultSet result =
160+
batch.executeQuery(parsedStatement, AnalyzeMode.NONE, InternalMetadataQuery.INSTANCE);
161+
assertThat(result.hashCode(), is(equalTo(resultSet.hashCode())));
164162
}
165163

166164
@Test

0 commit comments

Comments
 (0)