From 06d9e77445fddb296ddb6306b916fc50e09d127c Mon Sep 17 00:00:00 2001 From: Andreas Abraham Date: Mon, 14 May 2018 15:19:46 +0200 Subject: cast to base class added related to java api change from 8 to 9 --- BKUViewer/src/main/java/at/gv/egiz/bku/text/TextValidator.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'BKUViewer/src') diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/text/TextValidator.java b/BKUViewer/src/main/java/at/gv/egiz/bku/text/TextValidator.java index a7accd83..7beb24d5 100644 --- a/BKUViewer/src/main/java/at/gv/egiz/bku/text/TextValidator.java +++ b/BKUViewer/src/main/java/at/gv/egiz/bku/text/TextValidator.java @@ -30,6 +30,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; +import java.nio.Buffer; import java.nio.CharBuffer; import java.nio.charset.Charset; @@ -80,13 +81,13 @@ public class TextValidator implements Validator { char c; CharBuffer cb = CharBuffer.allocate(256); for (int l; (l = reader.read(cb)) != -1;) { - cb.flip(); + ((Buffer)cb).flip(); //java 9 workaround for (int i = 0; i < l; i++) { c = cb.get(); if (!viewerFont.canDisplay(c)) invalid(c); } } - cb.clear(); + ((Buffer)cb).clear(); //java 9 workaround } catch (IOException e) { // TODO: localize throw new ValidationException(e); -- cgit v1.2.3