kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | 15c1ca6363545eb4977c6a18aec941d606b5baea8e968f0768f0a54dce3be678 |
|---|---|
| Author | Alexandre Dutra <alexandre.dutra@datastax.com> · 2015-10-01 11:07 +02:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2015-10-14 22:15 +02:00 |
| Parents | 37395159ad9d |
3 files changed
modified driver-core/src/main/java/com/datastax/driver/core/MaterializedViewMetadata.java +4 −3
| @@ -74,9 +74,10 @@ | ||
| 74 | 74 | |
| 75 | 75 | int partitionKeySize = findCollectionSize(rawCols.values(), ColumnMetadata.Raw.Kind.PARTITION_KEY); |
| 76 | 76 | int clusteringSize = findCollectionSize(rawCols.values(), ColumnMetadata.Raw.Kind.CLUSTERING_COLUMN); |
| 77 | - List<ColumnMetadata> partitionKey = nullInitializedList(partitionKeySize); | |
| 78 | - List<ColumnMetadata> clusteringColumns = nullInitializedList(clusteringSize); | |
| 79 | - List<Order> clusteringOrder = nullInitializedList(clusteringSize); | |
| 77 | + | |
| 78 | + List<ColumnMetadata> partitionKey = new ArrayList<ColumnMetadata>(Collections.<ColumnMetadata>nCopies(partitionKeySize, null)); | |
| 79 | + List<ColumnMetadata> clusteringColumns = new ArrayList<ColumnMetadata>(Collections.<ColumnMetadata>nCopies(clusteringSize, null)); | |
| 80 | + List<Order> clusteringOrder = new ArrayList<Order>(Collections.<Order>nCopies(clusteringSize, null)); | |
| 80 | 81 | |
| 81 | 82 | // We use a linked hashmap because we will keep this in the order of a 'SELECT * FROM ...'. |
| 82 | 83 | LinkedHashMap<String, ColumnMetadata> columns = new LinkedHashMap<String, ColumnMetadata>(); |
modified driver-core/src/main/java/com/datastax/driver/core/TableMetadata.java +3 −5
| @@ -15,10 +15,8 @@ | ||
| 15 | 15 | */ |
| 16 | 16 | package com.datastax.driver.core; |
| 17 | 17 | |
| 18 | - | |
| 19 | 18 | import java.util.*; |
| 20 | 19 | |
| 21 | -import com.google.common.base.*; | |
| 22 | 20 | import com.google.common.base.Objects; |
| 23 | 21 | import org.slf4j.Logger; |
| 24 | 22 | import org.slf4j.LoggerFactory; |
| @@ -123,9 +121,9 @@ | ||
| 123 | 121 | isCompact = isDense || !comparator.isComposite; |
| 124 | 122 | } |
| 125 | 123 | |
| 126 | - List<ColumnMetadata> partitionKey = nullInitializedList(partitionKeySize); | |
| 127 | - List<ColumnMetadata> clusteringColumns = nullInitializedList(clusteringSize); | |
| 128 | - List<Order> clusteringOrder = nullInitializedList(clusteringSize); | |
| 124 | + List<ColumnMetadata> partitionKey = new ArrayList<ColumnMetadata>(Collections.<ColumnMetadata>nCopies(partitionKeySize, null)); | |
| 125 | + List<ColumnMetadata> clusteringColumns = new ArrayList<ColumnMetadata>(Collections.<ColumnMetadata>nCopies(clusteringSize, null)); | |
| 126 | + List<Order> clusteringOrder = new ArrayList<Order>(Collections.<Order>nCopies(clusteringSize, null)); | |
| 129 | 127 | |
| 130 | 128 | // We use a linked hashmap because we will keep this in the order of a 'SELECT * FROM ...'. |
| 131 | 129 | LinkedHashMap<String, ColumnMetadata> columns = new LinkedHashMap<String, ColumnMetadata>(); |
modified driver-core/src/main/java/com/datastax/driver/core/TableOrView.java +0 −7
| @@ -78,13 +78,6 @@ | ||
| 78 | 78 | this.cassandraVersion = cassandraVersion; |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | - protected static <T> List<T> nullInitializedList(int size) { | |
| 82 | - List<T> l = new ArrayList<T>(size); | |
| 83 | - for (int i = 0; i < size; ++i) | |
| 84 | - l.add(null); | |
| 85 | - return l; | |
| 86 | - } | |
| 87 | - | |
| 88 | 81 | /** |
| 89 | 82 | * Returns the name of this table. |
| 90 | 83 | * |