Skip to content

Commit

Permalink
Remove some unnecessary catch blocks (apache#7034)
Browse files Browse the repository at this point in the history
  • Loading branch information
coheigea authored and lukecwik committed Nov 14, 2018
1 parent 825534c commit 068ffe8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,7 @@ public static void main(String[] args) throws IOException {
private static Double tryParseAvgSpeed(String[] inputItems) {
try {
return Double.parseDouble(tryParseString(inputItems, 9));
} catch (NumberFormatException e) {
return null;
} catch (NullPointerException e) {
} catch (NumberFormatException | NullPointerException e) {
return null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import static java.nio.charset.StandardCharsets.UTF_8;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.ReadableByteChannel;
Expand Down Expand Up @@ -157,8 +156,6 @@ public static String readLineOfLogFile(Path path) {

try (BufferedReader br = Files.newBufferedReader(Paths.get(path.toString()), UTF_8)) {
return br.readLine();
} catch (FileNotFoundException e) {
LOG.error("Error reading the first line of file", e);
} catch (IOException e) {
LOG.error("Error reading the first line of file", e);
}
Expand Down

0 comments on commit 068ffe8

Please sign in to comment.