RFR: 8209937: Enhance java.io.Console - provide methods to query console width and height

Langer, Christoph christoph.langer at sap.com
Fri Aug 24 13:18:23 UTC 2018


Hi Rémi, Hi Peter,

thanks for your quick answers.

What you've suggested, Rémi, is perfectly right. I've updated my webrev. The methods were copied from our old implementation (of a different class) where they were provided as static.

I will also think of using an optional. I'm furthermore wondering if we should provide a method "dimensions()" returning an (optional) java.io.Console.Dimension object that contains both height and width...

Here is a new webrev: http://cr.openjdk.java.net/~clanger/webrevs/8209937.1/ 

Best regards
Christoph

> -----Original Message-----
> From: Peter Levart <peter.levart at gmail.com>
> Sent: Freitag, 24. August 2018 13:06
> To: Remi Forax <forax at univ-mlv.fr>; Langer, Christoph
> <christoph.langer at sap.com>
> Cc: core-libs-dev <core-libs-dev at openjdk.java.net>; Baesken, Matthias
> <matthias.baesken at sap.com>
> Subject: Re: RFR: 8209937: Enhance java.io.Console - provide methods to
> query console width and height
> 
> 
> 
> On 08/24/2018 12:09 PM, Remi Forax wrote:
> > Hi Christoph,
> > getWidth() and getHeight() should be instance methods and not static
> methods, providing the weight or the height if there is no console seems
> weird.
> > Also, they should be named width() and height() given the rest of the
> methods of java.io.Console doesn't use the "get" convention.
> >
> > regards,
> > Rémi
> 
> They could also return OptionalInt to force user to think about
> "not-available" situations.
> 
> Regards, Peter
> 
> >
> > ----- Mail original -----
> >> De: "Christoph Langer" <christoph.langer at sap.com>
> >> À: "core-libs-dev" <core-libs-dev at openjdk.java.net>
> >> Cc: "Baesken, Matthias" <matthias.baesken at sap.com>
> >> Envoyé: Vendredi 24 Août 2018 11:33:05
> >> Objet: RFR: 8209937: Enhance java.io.Console - provide methods to query
> console width and height
> >> Hi,
> >>
> >> please review and give feedback for this augmentation of java.io.Console.
> >>
> >> We have users that have the need to query for Width and Height of the
> console
> >> device in Java. In our own JVM implementation we had given them this
> hook as a
> >> custom extension already quite some time ago. We think, however, that
> it is a
> >> worthwhile augmentation of java.io.Console.
> >>
> >> Bug: https://bugs.openjdk.java.net/browse/JDK-8209937
> >> Webrev: http://cr.openjdk.java.net/~clanger/webrevs/8209937.0/
> >>
> >> I'll also open a CSR for this, but I'll wait for some feedback on our proposal
> >> first.
> >>
> >> Thanks & Best regards
> >> Christoph



More information about the core-libs-dev mailing list