RFR: 8281259: MutableBigInteger subtraction could be simplified

2022-02-04 Thread Daniel Jeliński
The proposed form of borrow bit handling is [already used in BigInteger class](https://github.com/djelinski/jdk/blob/ce26a19be5e907c11164b46f1bcb370b534d5bf6/src/java.base/share/classes/java/math/BigInteger.java#L1558). JMH results without the patch: Benchmark(maxNumbits) Mode Cnt

HashMap.putAll can cause redundant space waste

2022-02-04 Thread Xeno Amess
import java.lang.reflect.Array; import java.lang.reflect.Field; import java.util.HashMap; import java.util.Map; public class TestMap { public static void main(String[] args) throws NoSuchFieldException, IllegalAccessException { HashMap a = new HashMap<>(); fill12(a); H

Re: HashMap.putAll can cause redundant space waste

2022-02-04 Thread Xeno Amess
also find some other places have same problem. If some of your already-in people aggree, I would create a pr, but according to the rules seems I should wait for now. Xeno Amess 于2022年2月4日周五 18:42写道: > import java.lang.reflect.Array; > import java.lang.reflect.Field; > import java.util.HashMap; >

Integrated: JDK-8277795: ldap connection timeout not honoured under contention

2022-02-04 Thread Rob McKenna
On Thu, 25 Nov 2021 23:54:18 GMT, Rob McKenna wrote: > This fix attemps to resolve an issue where threads can stack up on each other > while waiting to get a connection from the ldap pool to an unreachable > server. It does this by having each thread start a countdown prior to holding > the po

Re: HashMap.putAll can cause redundant space waste

2022-02-04 Thread Xeno Amess
patch applied. Index: src/java.base/share/classes/java/lang/Module.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 === diff --git a/src/java.base/share/classes/java/lang/Module.java b/src/

Re: HashMap.putAll can cause redundant space waste

2022-02-04 Thread Xeno Amess
Besides, is it worthy to develop a public float Math.ceil(float) function? Xeno Amess 于2022年2月4日周五 21:39写道: > patch applied. > > Index: src/java.base/share/classes/java/lang/Module.java > IDEA additional info: > Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP > <+>UTF-8 > =

RFR: 8280409: JarFile::verifiableEntry can fail with NPE accessing ze.getName()

2022-02-04 Thread Lance Andersen
Hi all, Please review the attached patch to address - That JarFile::getInputStream did not check for a null ZipEntry passed as a parameter - Have Zip/JarFile::getInputStream throw a ZipException in the event that an unexpected exception occurs Mach5 tiers1-3 runs are clean as are the TCK java.

Re: RFR: 8280409: JarFile::verifiableEntry can fail with NPE accessing ze.getName()

2022-02-04 Thread Alan Bateman
On Fri, 4 Feb 2022 12:42:39 GMT, Lance Andersen wrote: > Hi all, > > Please review the attached patch to address > > - That JarFile::getInputStream did not check for a null ZipEntry passed as a > parameter > - Have Zip/JarFile::getInputStream throw a ZipException in the event that an > unexpe

Re: RFR: 8280409: JarFile::verifiableEntry can fail with NPE accessing ze.getName()

2022-02-04 Thread Lance Andersen
On Fri, 4 Feb 2022 15:06:59 GMT, Alan Bateman wrote: >> Hi all, >> >> Please review the attached patch to address >> >> - That JarFile::getInputStream did not check for a null ZipEntry passed as a >> parameter >> - Have Zip/JarFile::getInputStream throw a ZipException in the event that an >>

RFR: 8272996: JNDI DNS provider fails to resolve SRV entries when IPV6 stack is enabled

2022-02-04 Thread Aleksei Efimov
Hi, JNDI's `DnsClient` can fail with `UncheckedIOException` during `connect` or `disconnect` method calls. It is a [know behavior](https://bugs.openjdk.java.net/browse/JDK-8236076) of `DatagramSocket`. Currently, `DnsClient` method is fast-fails when `UncheckedIOException` is observed during c

Re: RFR: 8272996: JNDI DNS provider fails to resolve SRV entries when IPV6 stack is enabled

2022-02-04 Thread Daniel Fuchs
On Fri, 4 Feb 2022 15:36:35 GMT, Aleksei Efimov wrote: > Hi, > > JNDI's `DnsClient` can fail with `UncheckedIOException` during `connect` or > `disconnect` method calls. It is a [know > behavior](https://bugs.openjdk.java.net/browse/JDK-8236076) of > `DatagramSocket`. > > Currently, `DnsClie

Re: RFR: 8280409: JarFile::verifiableEntry can fail with NPE accessing ze.getName()

2022-02-04 Thread Sean Mullan
On Fri, 4 Feb 2022 12:42:39 GMT, Lance Andersen wrote: > Hi all, > > Please review the attached patch to address > > - That JarFile::getInputStream did not check for a null ZipEntry passed as a > parameter > - Have Zip/JarFile::getInputStream throw a ZipException in the event that an > unexpe

Re: RFR: 8280409: JarFile::verifiableEntry can fail with NPE accessing ze.getName()

2022-02-04 Thread Lance Andersen
On Fri, 4 Feb 2022 15:55:33 GMT, Sean Mullan wrote: > Could these unexpected exceptions also occur when using the `JarInputStream` > API? It's a different code path as Zip/JarFile leverage the CEN where Zip/JarInputStream leverage the LOC. I can give it a go and if there is an issue will cr

Re: RFR: 8280409: JarFile::verifiableEntry can fail with NPE accessing ze.getName()

2022-02-04 Thread Lance Andersen
On Fri, 4 Feb 2022 16:06:34 GMT, Lance Andersen wrote: > > Could these unexpected exceptions also occur when using the > > `JarInputStream` API? > > It's a different code path as Zip/JarFile leverage the CEN where > Zip/JarInputStream leverage the LOC. I can give it a go and if there is an >

Re: Seeking inputs on 8224794: ZipFile/JarFile should open zip/JAR file with FILE_SHARE_DELETE sharing mode on Windows

2022-02-04 Thread Daniel Fuchs
Hi Jaikiran, Thanks for working on this and apologies for the long silence. I believe your analysis of the issue is very valuable. Unless there is some clever trick we could do to allow to unlink the file from the file system before deleting it, so that the file path can be reused, it seems ind

Re: HashMap.putAll can cause redundant space waste

2022-02-04 Thread Xeno Amess
Sorry for my mistake. After a more throughout dig in, this thing has already fixed several years ago, at year 2015. Issue close. Xeno Amess 于2022年2月4日周五 21:40写道: > Besides, is it worthy to develop a public float Math.ceil(float) function? > > Xeno Amess 于2022年2月4日周五 21:39写道: > >> patch applied.

Re: HashMap.putAll can cause redundant space waste

2022-02-04 Thread Xeno Amess
wait, things get interesting now. We do have such a test named ConstantDirectoryOptimalCapacity to make sure this does not happen, but my tests still fill under the idea debugger. Is there any specialist for help? I would dig in but it is a little complicated. [image: image.png] Xeno Amess 于2022年

Re: RFR: 8281104: jar --create should create missing parent directories

2022-02-04 Thread Christian Stein
On Thu, 3 Feb 2022 21:43:30 GMT, Lance Andersen wrote: > I think this would be the appropriate place for documenting the behavior. Like this? -c, --create Create the archive. When the path specified by -f, --file contains a path, missing parent direct

Re: RFR: 8281104: jar --create should create missing parent directories

2022-02-04 Thread Lance Andersen
On Wed, 2 Feb 2022 20:21:54 GMT, Christian Stein wrote: > Calling `jar --create --file a/b/foo.jar INPUT-FILES` should create missing > parent directories (here `a/b`) on the default file system before storing the > JAR file (here `foo.jar`) in the destination directory. > > I think this would

Re: RFR: 8281104: jar --create should create missing parent directories [v2]

2022-02-04 Thread Lance Andersen
On Fri, 4 Feb 2022 21:55:28 GMT, Christian Stein wrote: >> Calling `jar --create --file a/b/foo.jar INPUT-FILES` should create missing >> parent directories (here `a/b`) on the default file system before storing >> the JAR file (here `foo.jar`) in the destination directory. > > Christian Stein

Re: RFR: 8281104: jar --create should create missing parent directories [v2]

2022-02-04 Thread Christian Stein
> Calling `jar --create --file a/b/foo.jar INPUT-FILES` should create missing > parent directories (here `a/b`) on the default file system before storing the > JAR file (here `foo.jar`) in the destination directory. Christian Stein has updated the pull request incrementally with one additional

Re: RFR: 8281104: jar --create should create missing parent directories

2022-02-04 Thread Christian Stein
On Wed, 2 Feb 2022 20:21:54 GMT, Christian Stein wrote: > Calling `jar --create --file a/b/foo.jar INPUT-FILES` should create missing > parent directories (here `a/b`) on the default file system before storing the > JAR file (here `foo.jar`) in the destination directory. Should I also extend t

Re: RFR: 8281104: jar --create should create missing parent directories

2022-02-04 Thread Lance Andersen
On Fri, 4 Feb 2022 21:47:16 GMT, Christian Stein wrote: > Should I also extend this "usage.compat" help message block? When and where > is it displayed? 🤔 > > https://github.com/openjdk/jdk/blob/48523b090886f7b24ed4009f0c150efaa6f7b056/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar.p

Re: RFR: 8281104: jar --create should create missing parent directories [v3]

2022-02-04 Thread Christian Stein
> Calling `jar --create --file a/b/foo.jar INPUT-FILES` should create missing > parent directories (here `a/b`) on the default file system before storing the > JAR file (here `foo.jar`) in the destination directory. Christian Stein has updated the pull request incrementally with one additional