Re: [PATCH] Simplification of TreeMap

2018-09-04 Thread Michael Kuhlmann
Hi Sergey, I was also wondering why TreeMap doesn't just use a default comparator and always checks for null instead. The problem with your patch is that deserialized TreeMap instances which were serialized from a previous version would still have the comparator set to null, thus resulting in a

Re: [PATCH] Simplification of TreeMap

2018-09-06 Thread Michael Kuhlmann
Hi Sergey and Sergey ;), that's totally correct! Serialization really is a beast sometimes, you have to take care that instances that have been serialized even with Java 1.2 still get deserialized correctly in the current version. So it's not sufficient to only look at the constructors when the

Re: 'Find' method for Iterable

2020-09-21 Thread Michael Kuhlmann
Hi Nir, at first I thought "Wow, it would be really cool to have that method in Iterable! Why isn't it there already?" But after thinking about it, I'm now convinced that it would be a bad idea. Because it extends the scope of this small, tiny Iterable interface to something bigger which it

Re: RFR: 8263668: Update java.time to use instanceof pattern variable

2021-03-24 Thread Michael Kuhlmann
On 3/24/21 12:09 PM, Rémi Forax wrote: On Wed, 24 Mar 2021 09:56:16 GMT, Patrick Concannon wrote: Hi, Could someone please review my code for updating the code in the `java.time` package to make use of the `instanceof` pattern variable? Kind regards, Patrick

Re: System.getEnv(String name, String def)

2021-02-16 Thread Michael Kuhlmann
Hi Rémi, I don't want to be pedantic, but I see this as an anti-pattern. You would create an Optional just to immediately call orElse() on it. That's not how Optional should be used. (But you know that.) It's described in Recipe 12 of this Java Magazine article, for instance:

Re: LambdaMetafactory requires full privilege access, but doesn't seem to actually restrict functionality

2022-01-18 Thread Michael Kuhlmann
Hi Steven! Sorry for coming back so lately; the main reason is that I can't answer your question. The issue you are describing indeed is a bit weird, and I can only speculate that it's like this because LambdaMetaFactory was mainly designed to be used in bootstrap methods for invokedynamic

Re: LambdaMetafactory requires full privilege access, but doesn't seem to actually restrict functionality

2022-01-20 Thread Michael Kuhlmann
Hi Steven! On 1/19/22 2:23 AM, Steven Schlansker wrote: Interestingly, that wasn't what I found. At least as of Java 14, the Metafactory generation approach (as limited as my first pass was) was competitive with CGLib hand-generated code in many (but not all) cases, and significantly faster

Re: fast way to infer caller

2022-04-07 Thread Michael Kuhlmann
On 4/7/22 19:27, Kasper Nielsen wrote: nope, see my previous mail to Ceki, the VM is cheating here if it can inline the call to MethodHandles.lookup() Does how the VM cheats really matter? The fact is that the code in the JDK can get the calling class and implement something like

Re: fast way to infer caller

2022-04-07 Thread Michael Kuhlmann
Good morning! On 4/7/22 23:59, Kasper Nielsen wrote: Hi Michael, I don't really have an opinion on how you obtain a logger. But one particular use-case I've had was that I would like to perform some access checks based on the module of the caller. Something similar to how Panama checks for

Re: core-libs-dev Digest Vol 180 Issue 174 Topic 1

2022-04-20 Thread Michael Kuhlmann
On 4/20/22 10:15, sminervini.prism wrote: > To the Java Community Process, and OpenJDK community, > > A number of us have been waiting on serious consideration for apprehension of > > core-libs-dev Digest Vol 180 Issue 174 Topic 1 > > since we have posted, but not received an addressal and