JEP 358 (Helpful NPEs) and single source file mode

2019-11-19 Thread Gunnar Morling
Hi, I've been exploring the new helpful NPE feature a bit. It's a very welcomed improvement, but I noticed one potential usability issue in conjunction with the single source file mode (JEP 330): as debug info is missing in that case, e.g. local variables are rendered as "" in the exception

Re: Compact Number Formatting and Fraction Digits

2019-01-18 Thread Gunnar Morling
Aaah, ok, so I *only* must call setMaximumFractionDigits(). That's the part I had missed so far; thanks! --Gunnar Am Fr., 18. Jan. 2019 um 00:35 Uhr schrieb Scott Palmer : > > > On Jan 17, 2019, at 2:22 PM, Gunnar Morling wrote: > > >> since you don’t actually want a mini

Re: Compact Number Formatting and Fraction Digits

2019-01-17 Thread Gunnar Morling
> since you don’t actually want a minimum. I'd like to have 1 fractional digit unless it's 0: 1,000 -> 1K (*not* 1.0K) 1,500 -> 1.5K --Gunnar Am Do., 17. Jan. 2019 um 19:15 Uhr schrieb Scott Palmer : > > > On Jan 17, 2019, at 12:42 PM, Gunnar Morling wrote: > > >&

Re: Compact Number Formatting and Fraction Digits

2019-01-17 Thread Gunnar Morling
n its feasibility. > > > > Regards, > > Nishit Jain > > On 17-01-2019 14:37, Gunnar Morling wrote: > >> Hi, > >> > >> I took a look at the compact number formatting recently added in JDK 12. > >> > >> There's setMinimumFractionD

Compact Number Formatting and Fraction Digits

2019-01-17 Thread Gunnar Morling
Hi, I took a look at the compact number formatting recently added in JDK 12. There's setMinimumFractionDigits() to control the number of fractional digits, so that e.g. 1,500 can be formatted as 1.5K. That's great, but it also will format 1,000 as 1.0K. Is there a way to have fractional digits

Re: Guaranteed order of annotations?

2017-02-03 Thread Gunnar Morling
he interim and I don't like it is likely to happen at this > point. > > HTH, > > -Joe > > > > On 1/17/2017 11:26 PM, Gunnar Morling wrote: >> >> Joseph, all, >> >> Thanks for the clarification. >> >> Are there chances to establish such gua

Re: Guaranteed order of annotations?

2017-01-17 Thread Gunnar Morling
is *not* a general ordering > constraint on the annotations returned by the methods of the > AnnotatedElement interface. > > HTH, > > -Joe > > > On 1/13/2017 1:16 PM, Gunnar Morling wrote: >> >> Hi Yuri, >> >> Thanks for the pointer. >> >&g

Re: Guaranteed order of annotations?

2017-01-13 Thread Gunnar Morling
sent" and annotation ordering > in Core Reflection for Annotations' [*]. > > Best regards, > -Yuri > > [*] https://bugs.openjdk.java.net/browse/JDK-8010679 > > > -Original Message- > From: core-libs-dev [mailto:core-libs-dev-boun...@openjdk.java.net] On Behal

Guaranteed order of annotations?

2017-01-13 Thread Gunnar Morling
Hi, Is there any order guaranteed in which an element's annotations are returned by AnnotatedElement#getDeclaredAnnotations()? Specifically, is this the order in which the annotations are given in the source code? Section 9.7.5. of the JLS ("Multiple Annotations of the Same Type") makes a

Proposal: Add a type token class for representing generic types

2016-12-16 Thread Gunnar Morling
Hi, I'd like to suggest the addition of a type token class to the Java class library, to be used for representing generic types such as List. Actual class literals can only represent raw types. But often libraries have the need to apply some sort of configuration to specific generic types, link

Accessing type annotations at runtime

2014-03-13 Thread Gunnar Morling
Hi, Is it possible to retrieve type annotations (as defined by JSR 308) using reflection at runtime? E.g. I would like to retrieve the @NotNull annotation from a member declared like this: private List@NotNull String names; I assumed that this would be possible using reflection, but I

Re: Accessing type annotations at runtime

2014-03-13 Thread Gunnar Morling
, --Gunnar 2014-03-13 15:39 GMT+01:00 Joe Darcy joe.da...@oracle.com: Hello, See the methods in java.lang.reflect named getAnnotedFoo which return java.lang.reflect.AnnotedType or a subinterface. -Joe On 3/13/2014 6:24 AM, Gunnar Morling wrote: Hi, Is it possible to retrieve type

Re: (reflect) Accessing members of inner annotations types

2014-01-10 Thread Gunnar Morling
Hi, Many thanks for the investigation and suggested workarounds. Bean Validation recommends to declare an inner @List annotation to specify several constraints of the same type on a given element, but its ok to deviate from that pattern in the rare cases of package-private constraint types. I

(reflect) Accessing members of inner annotations types

2014-01-03 Thread Gunnar Morling
Hi, In the course of running the Bean Validation TCK on JDK 8, I'm investigating an issue around reflectively accessing members of annotations which are declared as inner type of another, package-private annotation type. The following shows an example: @Retention( RetentionPolicy.RUNTIME )