Skip to content

Commit

Permalink
[ARROW-101] Fix java compiler rawtypes warnings
Browse files Browse the repository at this point in the history
Java compiler emits several warnings regarding the use of raw types.
This fixes the warnings by using generic types instead.
  • Loading branch information
laurentgo committed Apr 14, 2016
1 parent 7b2153b commit 61bde83
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import io.netty.buffer.ArrowBuf;

import java.util.Collections;
import java.util.Iterator;

import org.apache.arrow.memory.BufferAllocator;
Expand Down Expand Up @@ -109,8 +110,8 @@ public TransferPair getTransferPair(BufferAllocator allocator) {
// }

@Override
public Iterator iterator() {
return Iterators.emptyIterator();
public Iterator<ValueVector> iterator() {
return Collections.emptyIterator();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,16 @@ private void setWriter(ValueVector v) {
state = State.SINGLE;
vector = v;
type = v.getField().getType().getMinorType();
Class writerClass = BasicTypeHelper
Class<?> writerClass = BasicTypeHelper
.getWriterImpl(v.getField().getType().getMinorType(), v.getField().getDataMode());
if (writerClass.equals(SingleListWriter.class)) {
writerClass = UnionListWriter.class;
}
Class vectorClass = BasicTypeHelper.getValueVectorClass(v.getField().getType().getMinorType(), v.getField()
Class<?> vectorClass = BasicTypeHelper.getValueVectorClass(v.getField().getType().getMinorType(), v.getField()
.getDataMode());
try {
Constructor constructor = null;
for (Constructor c : writerClass.getConstructors()) {
Constructor<?> constructor = null;
for (Constructor<?> c : writerClass.getConstructors()) {
if (c.getParameterTypes().length == 3) {
constructor = c;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public boolean equals(Object obj) {
if (!(obj instanceof List)) {
return false;
}
List other = (List) obj;
List<?> other = (List<?>) obj;
return this.size() == other.size() && this.containsAll(other);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public boolean equals(Object obj) {
if (!(obj instanceof Map)) {
return false;
}
Map other = (Map) obj;
Map<?, ?> other = (Map<?, ?>) obj;
if (this.size() != other.size()) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ public void testListVectorShouldNotThrowOversizedAllocationException() throws Ex
vector.clear();
}

vectorFrom.clear();
vector.clear();
vectorFrom.close();
vector.close();
}
}

0 comments on commit 61bde83

Please sign in to comment.