8269130: Replace usages of Collection.toArray() with Collection.toArray(T[]) to avoid redundant array copying

Reviewed-by: mullan, serb
This commit is contained in:
Andrey Turbanov 2021-08-10 13:27:59 +00:00 committed by Jayathirth D V
parent 2b05fae155
commit 35b399aca8
8 changed files with 16 additions and 70 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -427,13 +427,7 @@ public class JoinRowSetImpl extends WebRowSetImpl implements JoinRowSet {
* @see CachedRowSet#setTableName
*/
public String[] getRowSetNames() throws SQLException {
Object [] arr = vecTableNames.toArray();
String []strArr = new String[arr.length];
for( int i = 0;i < arr.length; i++) {
strArr[i] = arr[i].toString();
}
String[] strArr = vecTableNames.toArray(new String[0]);
return strArr;
}