File: catch_IOException_LineIterator.patch

package info (click to toggle)
libgoby-java 3.3.1%2Bdfsg2-12
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 58,108 kB
  • sloc: java: 78,105; cpp: 5,011; xml: 3,170; python: 2,108; sh: 1,575; ansic: 277; makefile: 114
file content (21 lines) | stat: -rw-r--r-- 728 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Description: Catch the IOException launched by close() method of LineIterator
Author: Pierre Gruet <pgt@debian.org>
Forwarded: https://github.com/CampagneLaboratory/goby3/issues/7
Last-Update: 2020-11-03

--- a/goby-distribution/src/main/java/org/campagnelab/goby/modes/EmpiricalPMode.java
+++ b/goby-distribution/src/main/java/org/campagnelab/goby/modes/EmpiricalPMode.java
@@ -342,7 +342,12 @@
             Object next = it.next();
             lineCount++;
         }
-        it.close();
+        try {
+            it.close();
+        } catch (IOException e) {
+            System.err.println("Could not close LineIterator on " + inputFilename);
+            System.exit(1);
+        }
         return lineCount;
     }