oleg-zinovev commented on a change in pull request #1446: DRILL-6349: Drill
JDBC driver fails on Java 1.9+ with NoClassDefFoundError: sun/misc/VM
URL: https://github.com/apache/drill/pull/1446#discussion_r213386245
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/planner/FileSystemPartitionDescriptor.java
##########
@@ -179,7 +179,7 @@ protected void createPartitionSublists() {
// build a list of DFSDirPartitionLocation.
for (final List<String> dirs : dirToFileMap.keySet()) {
- locations.add( new DFSDirPartitionLocation((String [])dirs.toArray(),
dirToFileMap.get(dirs)));
+ locations.add( new DFSDirPartitionLocation(dirs.toArray(new String [0]),
dirToFileMap.get(dirs)));
Review comment:
According to
https://stackoverflow.com/questions/174093/toarraynew-myclass0-or-toarraynew-myclassmylist-size
`.toArray(new T[0])` faster
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services