diff options
| author | Ben Culkin <scorpress@gmail.com> | 2020-03-30 20:58:40 -0400 |
|---|---|---|
| committer | Ben Culkin <scorpress@gmail.com> | 2020-03-30 20:58:40 -0400 |
| commit | 2d140567edf035fe665f66b78d488bc12c0f157b (patch) | |
| tree | 878f14d1834687761cf6f497f660e460330428ed /src/examples/java | |
| parent | 43a1c34c3b606d4e5db0633cfd651de5309c5b5f (diff) | |
Clean up warnings
Clear up some warnings that had popped up. Mostly, closing some input
streams after we're done with them.
Diffstat (limited to 'src/examples/java')
| -rw-r--r-- | src/examples/java/bjc/inflexion/examples/InflexionTester.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/examples/java/bjc/inflexion/examples/InflexionTester.java b/src/examples/java/bjc/inflexion/examples/InflexionTester.java index ff5dcd7..0595cfa 100644 --- a/src/examples/java/bjc/inflexion/examples/InflexionTester.java +++ b/src/examples/java/bjc/inflexion/examples/InflexionTester.java @@ -48,11 +48,18 @@ public class InflexionTester { */ public static void main(final String[] args) { final Prepositions prepositionDB = new Prepositions(); - prepositionDB.loadFromStream( - InflexionTester.class.getResourceAsStream("/prepositions.txt")); + try (InputStream strim = InflectionML.class.getResourceAsStream("/prepositions.txt")) { + prepositionDB.loadFromStream(strim); + } catch (IOException ioex) { + ioex.printStackTrace(); + } - final Nouns nounDB = new Nouns(prepositionDB); - nounDB.loadFromStream(InflexionTester.class.getResourceAsStream("/nouns.txt")); + Nouns nounDB = new Nouns(prepositionDB); + try (InputStream strim = InflectionML.class.getResourceAsStream("/nouns.txt")) { + nounDB.loadFromStream(strim); + } catch (IOException ioex) { + ioex.printStackTrace(); + } final Scanner scn = new Scanner(System.in); |
