Re: RFR: 4511638: Double.toString(double) sometimes produces incorrect results [v2]

2021-04-18 Thread Andrey Turbanov
On Fri, 16 Apr 2021 11:30:32 GMT, Raffaello Giulietti wrote: >> Hello, >> >> here's a PR for a patch submitted on March 2020 >> [1](https://cr.openjdk.java.net/~bpb/4511638/webrev.04/) when Mercurial was >> a thing. >> >> The patch has been edited to adhere to OpenJDK code conventions about

Re: RFR: 8200559: Java agents doing instrumentation need a means to define auxilary classes

2021-04-18 Thread Rafael Winterhalter
As for the need to inject classes into 'new' packages, in Mockito we solve this easily by 'claiming' a package by defining a static dummy class within it which we then use as a hook for injection using a lookup. This works well for us, and I do of course not know the explicit requirements of

Re: RFR: 8265237: String.join and StringJoiner can be improved further [v2]

2021-04-18 Thread Peter Levart
On Fri, 16 Apr 2021 23:02:33 GMT, Peter Levart wrote: >> src/java.base/share/classes/java/lang/String.java line 3254: >> >>> 3252: >>> 3253: byte[] value = StringConcatHelper.newArray(((long) icoder << >>> 32) | llen); >>> 3254: int off = 0; >> >>

Re: RFC: 8200559: Java agents doing instrumentation need a means to define auxiliary classes

2021-04-18 Thread Rafael Winterhalter
'legitimate' is probably a poor choice of word. What I mean to express is that libraries, other than agents, are able to address class loaders explicitly in their APIs and can often expect to share a hierarchy with the code they interact with. Using method handles and the defineClass method, you

Re: RFR: 8265237: String.join and StringJoiner can be improved further [v3]

2021-04-18 Thread Peter Levart
On Sun, 18 Apr 2021 19:55:20 GMT, Peter Levart wrote: >> While JDK-8148937 improved StringJoiner class by replacing internal use of >> getChars that copies out characters from String elements into a char[] array >> with StringBuilder which is somehow more optimal, the improvement was >>

Re: RFR: 8265237: String.join and StringJoiner can be improved further [v3]

2021-04-18 Thread Peter Levart
> While JDK-8148937 improved StringJoiner class by replacing internal use of > getChars that copies out characters from String elements into a char[] array > with StringBuilder which is somehow more optimal, the improvement was > marginal in speed (0% ... 10%) and mainly for smaller strings,

Re: RFR: 8200559: Java agents doing instrumentation need a means to define auxilary classes

2021-04-18 Thread Alan Bateman
On 16/04/2021 21:09, Rafael Winterhalter wrote: I have never seen a need for a non-agent to define a class in a non-existing package. Injection is typically required if you want to work with package-private types or methods which is really only relevant for the Spring framework, but even there I

RFR: 8265152: jpackage cleanup fails on Windows with IOException deleting msi

2021-04-18 Thread Yasumasa Suenaga
When creating an "exe" installer on Windows, `AbstractBundler.cleanup()` calls `IOUtils.deleteRecursive()` to delete the tmp directory. It can intermittently fail trying to delete the msi file. [JDK-8263135](https://bugs.openjdk.java.net/browse/JDK-8263135) removed `unique_ptr` from jpackage

Re: RFC: 8200559: Java agents doing instrumentation need a means to define auxiliary classes

2021-04-18 Thread Ron Pressler
Hi Rafael! The use cases you mention might be legitimate, but why are they legitimate *for agents*? For example, why can’t the Replacement class be defined in a regular library, not injected by the agent? As to the existence of Unsafe hacks and others, those are going away, so “we can do

Re: ReversibleCollection proposal

2021-04-18 Thread Peter Levart
On 4/18/21 9:51 AM, Peter Levart wrote: public interface Collection {     default Collection reversed() { return this; }     default void addFirst(E e) { throw new UnsupportedOperationException(); }     default void addLast(E e) { throw new UnsupportedOperationException(); }

Re: ReversibleCollection proposal

2021-04-18 Thread Peter Levart
On 4/18/21 9:51 AM, Peter Levart wrote: public interface Collection {     default Collection reversed() { return this; }     default void addFirst(E e) { throw new UnsupportedOperationException(); }     default void addLast(E e) { throw new UnsupportedOperationException(); }

Re: ReversibleCollection proposal

2021-04-18 Thread Peter Levart
A word for Remi's concern... While it is good that List (and SortedSet and Deque) extend ReversibleCollection in the proposal, it is a pity the same is not true for Set and Queue. If Set and Queue could also be ReversibleCollection(s), then we would not need ReversibleCollection at all and

Re: How to know if cpu supports unaligned memory accesses ?

2021-04-18 Thread Alan Bateman
On 17/04/2021 19:02, Laurent Bourgès wrote: Hi, In the Marlin renderer & in other Unsafe use cases (pixel tile processing) for java2d pipelines, I do use putInt()/putLong() primitives even if the address is not aligned (to 4 or 8 bytes) to get faster processing of byte buffer or arrays... Is