--- old/src/java.base/share/classes/java/io/Console.java 2018-08-24 15:15:26.996841300 +0200 +++ new/src/java.base/share/classes/java/io/Console.java 2018-08-24 15:15:25.447764700 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,8 +25,11 @@ package java.io; -import java.util.*; import java.nio.charset.Charset; +import java.util.Arrays; +import java.util.Formatter; +import java.util.IllegalFormatException; + import jdk.internal.misc.JavaIOAccess; import jdk.internal.misc.SharedSecrets; import sun.nio.cs.StreamDecoder; @@ -390,6 +393,20 @@ pw.flush(); } + /** + * Obtains the width of the console window. + * + * @return The width or -1 if it cannot be obtained. + */ + public native int width(); + + /** + * Obtains the height of the console window. + * + * @return The height or -1 if it cannot be obtained. + */ + public native int height(); + private Object readLock; private Object writeLock; private Reader reader; @@ -401,6 +418,7 @@ private boolean restoreEcho; private boolean shutdownHookInstalled; private static native String encoding(); + /* * Sets the console echo status to {@code on} and returns the previous * console on/off status.