Skip to content

Commit

Permalink
ARROW-101: Fix java compiler warnings
Browse files Browse the repository at this point in the history
Fixes several warnings emitted by java compiler regarding the use of raw types and unclosed resources.

Author: Laurent Goujon <laurent.goujon@online.fr>

Closes #60 from laurentgo/laurent/fix-generic-warnings and squashes the following commits:

96ccc67 [Laurent Goujon] [ARROW-101] Fix java compiler resources warnings
61bde83 [Laurent Goujon] [ARROW-101] Fix java compiler rawtypes warnings
  • Loading branch information
laurentgo authored and wesm committed Aug 1, 2016
1 parent 356d015 commit 3a2dfba
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 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

0 comments on commit 3a2dfba

Please sign in to comment.