Skip to content

Commit

Permalink
Fix remaining valid Coverity warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
srowen committed Mar 11, 2016
1 parent 38b0b84 commit 1deecd8
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ class StreamInterceptor implements TransportFrameDecoder.Interceptor {
private final String streamId;
private final long byteCount;
private final StreamCallback callback;

private volatile long bytesRead;
private long bytesRead;

StreamInterceptor(
TransportResponseHandler handler,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ public int compare(
}
};

SparkConf sparkConf;
File tempDir;
@Mock(answer = RETURNS_SMART_NULLS) BlockManager blockManager;
@Mock(answer = RETURNS_SMART_NULLS) DiskBlockManager diskBlockManager;
Expand All @@ -99,7 +98,6 @@ public OutputStream apply(OutputStream stream) {
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
sparkConf = new SparkConf();
tempDir = Utils.createTempDir(System.getProperty("java.io.tmpdir"), "unsafe-test");
spillFilesCreated.clear();
taskContext = mock(TaskContext.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,7 @@ private void testCmdBuilder(boolean isDriver, boolean useDefaultPropertyFile) th

for (String arg : cmd) {
if (arg.startsWith("-XX:MaxPermSize=")) {
if (isDriver) {
assertEquals("-XX:MaxPermSize=256m", arg);
} else {
assertEquals("-XX:MaxPermSize=256m", arg);
}
assertEquals("-XX:MaxPermSize=256m", arg);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import java.util.Arrays;
import java.util.Iterator;
import java.util.NoSuchElementException;

import org.apache.commons.lang.NotImplementedException;

Expand Down Expand Up @@ -254,6 +255,9 @@ public Row next() {
while (rowId < maxRows && ColumnarBatch.this.filteredRows[rowId]) {
++rowId;
}
if (rowId >= maxRows) {
throw new NoSuchElementException();
}
row.rowId = rowId++;
return row;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public class JavaSaveLoadSuite {
private transient JavaSparkContext sc;
private transient SQLContext sqlContext;

String originalDefaultSource;
File path;
Dataset<Row> df;

Expand All @@ -57,7 +56,6 @@ public void setUp() throws IOException {
sqlContext = new SQLContext(_sc);
sc = new JavaSparkContext(_sc);

originalDefaultSource = sqlContext.conf().defaultDataSourceName();
path =
Utils.createTempDir(System.getProperty("java.io.tmpdir"), "datasource").getCanonicalFile();
if (path.exists()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public class JavaMetastoreDataSourcesSuite {
private transient JavaSparkContext sc;
private transient HiveContext sqlContext;

String originalDefaultSource;
File path;
Path hiveManagedPath;
FileSystem fs;
Expand All @@ -66,7 +65,6 @@ public void setUp() throws IOException {
sqlContext = TestHive$.MODULE$;
sc = new JavaSparkContext(sqlContext.sparkContext());

originalDefaultSource = sqlContext.conf().defaultDataSourceName();
path =
Utils.createTempDir(System.getProperty("java.io.tmpdir"), "datasource").getCanonicalFile();
if (path.exists()) {
Expand Down

0 comments on commit 1deecd8

Please sign in to comment.