You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Ted Yu (JIRA)" <ji...@apache.org> on 2016/03/25 22:47:25 UTC
[jira] [Updated] (FLINK-3668) Potential null deference in
HadoopInputFormatBase#createInputSplits()
[ https://issues.apache.org/jira/browse/FLINK-3668?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ted Yu updated FLINK-3668:
--------------------------
Description:
Here is the code:
{code}
List<org.apache.hadoop.mapreduce.InputSplit> splits;
try {
splits = this.mapreduceInputFormat.getSplits(jobContext);
} catch (InterruptedException e) {
throw new IOException("Could not get Splits.", e);
}
HadoopInputSplit[] hadoopInputSplits = new HadoopInputSplit[splits.size()];
{code}
If InterruptedException is caught, InterruptedIOException should be thrown - that's minor
The next line accesses splits.size() without null check - so far, I haven't found InputFormat which returns null from getSplits().
was:
Here is the code:
{code}
List<org.apache.hadoop.mapreduce.InputSplit> splits;
try {
splits = this.mapreduceInputFormat.getSplits(jobContext);
} catch (InterruptedException e) {
throw new IOException("Could not get Splits.", e);
}
HadoopInputSplit[] hadoopInputSplits = new HadoopInputSplit[splits.size()];
{code}
If InterruptedException is caught, splits would be null.
Yet, the next line accesses splits.size() without null check.
> Potential null deference in HadoopInputFormatBase#createInputSplits()
> ---------------------------------------------------------------------
>
> Key: FLINK-3668
> URL: https://issues.apache.org/jira/browse/FLINK-3668
> Project: Flink
> Issue Type: Bug
> Reporter: Ted Yu
> Priority: Minor
>
> Here is the code:
> {code}
> List<org.apache.hadoop.mapreduce.InputSplit> splits;
> try {
> splits = this.mapreduceInputFormat.getSplits(jobContext);
> } catch (InterruptedException e) {
> throw new IOException("Could not get Splits.", e);
> }
> HadoopInputSplit[] hadoopInputSplits = new HadoopInputSplit[splits.size()];
> {code}
> If InterruptedException is caught, InterruptedIOException should be thrown - that's minor
> The next line accesses splits.size() without null check - so far, I haven't found InputFormat which returns null from getSplits().
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)