Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Archie L . Cobbs
On Thu, 12 Jan 2023 21:47:28 GMT, Maurizio Cimadamore wrote: > Ok - I thought false negative was the thing to absolutely avoid - and that > was the no. 1 concern. You're right. I think at the time I reasoned that it would be unusual enough for the type of an expression to start as an

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Maurizio Cimadamore
On Thu, 12 Jan 2023 19:12:27 GMT, Archie L. Cobbs wrote: >> Uhm. Turns out I probably did not understand the filter correctly, and now >> I'm more dubious about what it actually does. Say you have this hierarchy: >> >> >> interface A { } >> class B { >> B() { >> A a = (A)this;

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v8]

2023-01-12 Thread Archie L . Cobbs
> This PR adds a new lint warning category `this-escape`. > > It also adds `@SuppressWarnings` annotations as needed to the JDK itself to > allow the JDK to continue to compile with `-Xlint:all`. > > A 'this' escape warning is generated for a constructor `A()` in a class `A` > when the

RFR: 8300077: Refactor code examples to use @snippet in java.text.ChoiceFormat

2023-01-12 Thread Justin Lu
This PR implements _JEP 413: Code Snippets in Java API Documentation_ for [java.text.ChoiceFormat](https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/text/ChoiceFormat.html). Code examples using ... blocks are replaced with the @ snippet syntax where applicable. -

Re: RFR: 8300011: Refactor code examples to use @snippet in java.util.TimeZone [v3]

2023-01-12 Thread Lance Andersen
On Thu, 12 Jan 2023 22:21:39 GMT, Justin Lu wrote: >> This PR implements JEP 413: Code Snippets in Java API Documentation for >> _[java.util.TimeZone](https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/util/TimeZone.html)_. >> >> Code examples using ... blocks are replaced

Integrated: Merge jdk20

2023-01-12 Thread Jesper Wilhelmsson
On Thu, 12 Jan 2023 20:57:49 GMT, Jesper Wilhelmsson wrote: > Forwardport JDK 20 -> JDK 21 This pull request has now been integrated. Changeset: 98870472 Author:Jesper Wilhelmsson URL: https://git.openjdk.org/jdk/commit/98870472282a76be14acb2dfba483c97359dabba Stats: 12 lines

Re: RFR: 8300011: Refactor code examples to use @snippet in java.util.TimeZone [v3]

2023-01-12 Thread Justin Lu
> This PR implements JEP 413: Code Snippets in Java API Documentation for > _[java.util.TimeZone](https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/util/TimeZone.html)_. > > Code examples using ... blocks are replaced with the @ snippet > syntax where applicable. Justin Lu

Re: RFR: 8300011: Refactor code examples to use @snippet in java.util.TimeZone [v2]

2023-01-12 Thread Justin Lu
On Thu, 12 Jan 2023 21:30:00 GMT, Justin Lu wrote: >> This PR implements JEP 413: Code Snippets in Java API Documentation for >> _[java.util.TimeZone](https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/util/TimeZone.html)_. >> >> Code examples using ... blocks are replaced

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Maurizio Cimadamore
On Thu, 12 Jan 2023 21:28:12 GMT, Archie L. Cobbs wrote: >> My point is about who puts ThisRef in the set to begin with. It seems to me >> that ThisRef is put there at the start of a method analysis. After which, >> there's several code points where we say "if there's a direct ThisRef in the

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Archie L . Cobbs
On Thu, 12 Jan 2023 19:01:10 GMT, Maurizio Cimadamore wrote: >> The code you quoted has nothing specifically to do with method invocations. >> This code is simply handing the evaluation of the expressions `this` and >> `super`. For example, `this` could just be a parameter we're passing to

Re: RFR: 8300011: Refactor code examples to use @snippet in java.util.TimeZone [v2]

2023-01-12 Thread Justin Lu
On Thu, 12 Jan 2023 21:08:12 GMT, Naoto Sato wrote: >> Justin Lu has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Move link to separate lines > > src/java.base/share/classes/java/util/TimeZone.java line 313: > >> 311: * This method

Re: RFR: 8300011: Refactor code examples to use @snippet in java.util.TimeZone [v2]

2023-01-12 Thread Justin Lu
> This PR implements JEP 413: Code Snippets in Java API Documentation for > _[java.util.TimeZone](https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/util/TimeZone.html)_. > > Code examples using ... blocks are replaced with the @ snippet > syntax where applicable. Justin Lu

Re: RFR: 8299865: Unnecessary NullPointerException catch in java.util.TimeZone#setDefaultZone

2023-01-12 Thread Naoto Sato
On Wed, 11 Jan 2023 17:12:39 GMT, Justin Lu wrote: > In [JDK-4368016](https://bugs.openjdk.org/browse/JDK-4368016) > **TimeZone.setDefaultZone()** was updated so that > > _TimeZone.java [will] not cause an NPE. If getSystemTimeZoneID() > can't determine the time zone from java.home and

Re: RFR: 8300011: Refactor code examples to use @snippet in java.util.TimeZone

2023-01-12 Thread Naoto Sato
On Wed, 11 Jan 2023 23:41:46 GMT, Justin Lu wrote: > This PR implements JEP 413: Code Snippets in Java API Documentation for > _[java.util.TimeZone](https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/util/TimeZone.html)_. > > Code examples using ... blocks are replaced with

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Archie L . Cobbs
On Thu, 12 Jan 2023 19:24:50 GMT, Archie L. Cobbs wrote: >> This patch passes all tests: >> >> >> diff --git >> a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ThisEscapeAnalyzer.java >> >> b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ThisEscapeAnalyzer.java >> index

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Archie L . Cobbs
On Thu, 12 Jan 2023 18:48:25 GMT, Maurizio Cimadamore wrote: >>> I guess what I'm thinking about: >> >> No leak is possible in that example. >> * `new Foo()` creates an instance of `Foo` (not a subclass of `Foo`) >> therefore `m()` is not overridden >> * Any subclass of `Foo` that may exist

RFR: Merge jdk20

2023-01-12 Thread Jesper Wilhelmsson
Forwardport JDK 20 -> JDK 21 - Commit messages: - Merge remote-tracking branch 'jdk20/master' into Merge_jdk20 - 8299918: Update Xcode11.3.1-MacOSX10.15 devkit at Oracle - 8299034: Runtime::exec clarification of inherited environment - 8299439:

Re: RFR: 8299865: Unnecessary NullPointerException catch in java.util.TimeZone#setDefaultZone

2023-01-12 Thread Iris Clark
On Wed, 11 Jan 2023 17:12:39 GMT, Justin Lu wrote: > In [JDK-4368016](https://bugs.openjdk.org/browse/JDK-4368016) > **TimeZone.setDefaultZone()** was updated so that > > _TimeZone.java [will] not cause an NPE. If getSystemTimeZoneID() > can't determine the time zone from java.home and

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Archie L . Cobbs
On Thu, 12 Jan 2023 18:40:38 GMT, Maurizio Cimadamore wrote: >> This patch: >> >> >> diff --git a/make/test/BuildMicrobenchmark.gmk >> b/make/test/BuildMicrobenchmark.gmk >> index 1c89328a388..7c3f0293edc 100644 >> --- a/make/test/BuildMicrobenchmark.gmk >> +++

Re: RFR: 8299865: Unnecessary NullPointerException catch in java.util.TimeZone#setDefaultZone

2023-01-12 Thread Lance Andersen
On Wed, 11 Jan 2023 17:12:39 GMT, Justin Lu wrote: > In [JDK-4368016](https://bugs.openjdk.org/browse/JDK-4368016) > **TimeZone.setDefaultZone()** was updated so that > > _TimeZone.java [will] not cause an NPE. If getSystemTimeZoneID() > can't determine the time zone from java.home and

Integrated: 8299677: Formatter.format might take a long time to format an integer or floating-point

2023-01-12 Thread Raffaello Giulietti
On Wed, 11 Jan 2023 10:47:03 GMT, Raffaello Giulietti wrote: > This change transforms a O(n^2) path to O(n) when prepending zero padding to > decimal outputs, where n is the length of the padding. This pull request has now been integrated. Changeset: 33412c10 Author:Raffaello Giulietti

Re: RFR: 8299865: Unnecessary NullPointerException catch in java.util.TimeZone#setDefaultZone

2023-01-12 Thread Justin Lu
On Wed, 11 Jan 2023 17:34:13 GMT, Naoto Sato wrote: >> In [JDK-4368016](https://bugs.openjdk.org/browse/JDK-4368016) >> **TimeZone.setDefaultZone()** was updated so that >> >> _TimeZone.java [will] not cause an NPE. If getSystemTimeZoneID() >> can't determine the time zone from java.home and

Re: RFR: 8299865: Unnecessary NullPointerException catch in java.util.TimeZone#setDefaultZone

2023-01-12 Thread Naoto Sato
On Wed, 11 Jan 2023 17:12:39 GMT, Justin Lu wrote: > In [JDK-4368016](https://bugs.openjdk.org/browse/JDK-4368016) > **TimeZone.setDefaultZone()** was updated so that > > _TimeZone.java [will] not cause an NPE. If getSystemTimeZoneID() > can't determine the time zone from java.home and

RFR: 8299865: Unnecessary NullPointerException catch in java.util.TimeZone#setDefaultZone

2023-01-12 Thread Justin Lu
In [JDK-4368016](https://bugs.openjdk.org/browse/JDK-4368016) **TimeZone.setDefaultZone()** was updated so that _TimeZone.java [will] not cause an NPE. If getSystemTimeZoneID() can't determine the time zone from java.home and user.region properties, it returns GMT._ This change updates the

RFR: 8300011: Refactor code examples to use @snippet in java.util.TimeZone

2023-01-12 Thread Justin Lu
This PR implements JEP 413: Code Snippets in Java API Documentation for _[java.util.TimeZone](https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/util/TimeZone.html)_. Code examples using ... blocks are replaced with the @ snippet syntax where applicable. - Commit

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Archie L . Cobbs
On Thu, 12 Jan 2023 17:40:36 GMT, Maurizio Cimadamore wrote: > But the filtering will end up dropping the expression Ref on the floor, > right? (because B and A are unrelated). Ah, I see what you mean. Here's a more complete example: public class CastLeak { public CastLeak() {

Re: RFR: 8299677: Formatter.format might take a long time to format an integer or floating-point [v5]

2023-01-12 Thread Joe Darcy
On Thu, 12 Jan 2023 15:31:03 GMT, Raffaello Giulietti wrote: >> This change transforms a O(n^2) path to O(n) when prepending zero padding to >> decimal outputs, where n is the length of the padding. > > Raffaello Giulietti has updated the pull request incrementally with one > additional

Re: ZipFile.isSignatureRelated returns true for files in META-INF subdirectories

2023-01-12 Thread Eirik Bjørsnøs
> > ZipFile.isSignatureRelated currently returns true for paths such as the > following: > > > META-INF/libraries/org.bouncycastle:bcprov-jdk15on:jar-1.70/META-INF/BC2048KE.DSA > I found a couple more call sites of SignatureFileVerifier.isBlockOrSF which incorrectly treat [SF,DSA,RSA,EC] files as

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Maurizio Cimadamore
On Thu, 12 Jan 2023 17:33:48 GMT, Archie L. Cobbs wrote: >> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ThisEscapeAnalyzer.java >> line 875: >> >>> 873: // Reference to this? >>> 874: if (tree.name == names._this || tree.name == names._super) { >>> 875:

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Archie L . Cobbs
On Thu, 12 Jan 2023 17:29:22 GMT, Maurizio Cimadamore wrote: >> I put it there because of switch expressions and `yeild`... ? > > Well, yield can... yield a value - `case` doesn't. So I'm confused. Also > because the variable is called `referenceExpressionNode` and `CASE` is not an >

Re: RFR: JDK-8295859: Update Manual Test Groups [v4]

2023-01-12 Thread Bill Huang
> This task is created to update the manual test groups. Bill Huang has updated the pull request incrementally with one additional commit since the last revision: Removed performance tests from the jdk_core_manual group as they have been covered in the client-atr test groups -

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Maurizio Cimadamore
On Thu, 12 Jan 2023 18:37:06 GMT, Archie L. Cobbs wrote: >> I guess what I'm thinking about: >> >> class Foo { >> private Foo() { >> m(this); >> } >> >> public void m() { ... } // overridable >> >> static Foo makeFoo() { return new Foo(); } >> } > >> I guess

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Maurizio Cimadamore
On Thu, 12 Jan 2023 18:18:38 GMT, Maurizio Cimadamore wrote: >> I can't seem to be able to run tests - I get failures in the build: >> >> >> * For target support_test_micro_tools-classes__the.BUILD_INDIFY_batch: > > This patch: > > > diff --git a/make/test/BuildMicrobenchmark.gmk >

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Archie L . Cobbs
On Thu, 12 Jan 2023 16:40:33 GMT, Maurizio Cimadamore wrote: > I guess what I'm thinking about: No leak is possible in that example. * `new Foo()` creates an instance of `Foo` (not a subclass of `Foo`) therefore `m()` is not overridden * Any subclass of `Foo` that may exist in the outside

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Maurizio Cimadamore
On Thu, 12 Jan 2023 18:11:01 GMT, Maurizio Cimadamore wrote: >> Same comment as previous: I don't quite know what I'm doing and I'm loathe >> to break what is already working. Do you have a suggested patch? > > I can't seem to be able to run tests - I get failures in the build: > > > * For

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Archie L . Cobbs
On Thu, 12 Jan 2023 12:28:12 GMT, Maurizio Cimadamore wrote: > This might also be related with the fact that we deal with return values in > different ways than with e.g. values returned from a nested scope (where we > just pop, and then copy all pending expression to the outer depth). Yes,

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Maurizio Cimadamore
On Thu, 12 Jan 2023 17:48:37 GMT, Archie L. Cobbs wrote: >> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ThisEscapeAnalyzer.java >> line 909: >> >>> 907: >>> 908: // Check for implicit outer 'this' reference >>> 909: if

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Archie L . Cobbs
On Thu, 12 Jan 2023 17:39:05 GMT, Vicente Romero wrote: >> Archie L. Cobbs has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - Use the more appropriate Type comparison method Types.isSameType(). >> - Add some more comments to clarify how

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Archie L . Cobbs
On Thu, 12 Jan 2023 12:26:27 GMT, Maurizio Cimadamore wrote: > Do we really need a set for this? There are surely other ways to model things. But I got myself really confused trying to build more complicated models. What I ended up with is this simple model that works: * There is a set of

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Archie L . Cobbs
On Thu, 12 Jan 2023 12:17:32 GMT, Maurizio Cimadamore wrote: > There is a concept of push/popScope and then there's a separate concept of > call stack (which is just a list of diagnostic position up to the point). I > wonder if this could be better modeled by using a single class e.g. >

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Archie L . Cobbs
On Thu, 12 Jan 2023 12:15:17 GMT, Maurizio Cimadamore wrote: >> Archie L. Cobbs has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - Use the more appropriate Type comparison method Types.isSameType(). >> - Add some more comments to

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Archie L . Cobbs
On Thu, 12 Jan 2023 11:09:35 GMT, Maurizio Cimadamore wrote: >> Archie L. Cobbs has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - Use the more appropriate Type comparison method Types.isSameType(). >> - Add some more comments to

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Maurizio Cimadamore
On Thu, 12 Jan 2023 17:13:55 GMT, Archie L. Cobbs wrote: >> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ThisEscapeAnalyzer.java >> line 411: >> >>> 409: final boolean referenceExpressionNode; >>> 410: switch (tree.getTag()) { >>> 411: case CASE: >> >>

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Vicente Romero
On Wed, 11 Jan 2023 03:30:03 GMT, Archie L. Cobbs wrote: >> This PR adds a new lint warning category `this-escape`. >> >> It also adds `@SuppressWarnings` annotations as needed to the JDK itself to >> allow the JDK to continue to compile with `-Xlint:all`. >> >> A 'this' escape warning is

RFR: 8300010: UnsatisfiedLinkError on calling System.console().readPassword() on Windows

2023-01-12 Thread Naoto Sato
Fixing a regression caused by the fix to [JDK-8298971](https://bugs.openjdk.org/browse/JDK-8298971). The previous fix lacked the native part change on Windows. - Commit messages: - 8300010: UnsatisfiedLinkError on calling System.console().readPassword() on Windows Changes:

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Archie L . Cobbs
On Thu, 12 Jan 2023 10:56:53 GMT, Maurizio Cimadamore wrote: >> Archie L. Cobbs has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - Use the more appropriate Type comparison method Types.isSameType(). >> - Add some more comments to

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Archie L . Cobbs
On Thu, 12 Jan 2023 10:48:49 GMT, Maurizio Cimadamore wrote: >> Archie L. Cobbs has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - Use the more appropriate Type comparison method Types.isSameType(). >> - Add some more comments to

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Maurizio Cimadamore
On Thu, 12 Jan 2023 16:20:12 GMT, Archie L. Cobbs wrote: >> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ThisEscapeAnalyzer.java >> line 218: >> >>> 216: new TreeScanner() { >>> 217: >>> 218: private Lint lint = ThisEscapeAnalyzer.this.lint; >> >> On a first

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Archie L . Cobbs
On Thu, 12 Jan 2023 10:32:19 GMT, Maurizio Cimadamore wrote: > If we have a class with a private constructor and public static factory > invoking said constructor, and the constructor makes this escape, isn't that > an issue we should detect? A static factory method will not create a

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Archie L . Cobbs
On Thu, 12 Jan 2023 10:25:27 GMT, Maurizio Cimadamore wrote: >> Archie L. Cobbs has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - Use the more appropriate Type comparison method Types.isSameType(). >> - Add some more comments to

Re: RFR: 8299677: Formatter.format might take a long time to format an integer or floating-point [v5]

2023-01-12 Thread Sergey Tsypanov
On Thu, 12 Jan 2023 15:31:03 GMT, Raffaello Giulietti wrote: >> This change transforms a O(n^2) path to O(n) when prepending zero padding to >> decimal outputs, where n is the length of the padding. > > Raffaello Giulietti has updated the pull request incrementally with one > additional

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Archie L . Cobbs
On Thu, 12 Jan 2023 10:18:27 GMT, Maurizio Cimadamore wrote: >> Archie L. Cobbs has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - Use the more appropriate Type comparison method Types.isSameType(). >> - Add some more comments to

Integrated: JDK-8298448: UndefinedBehaviorSanitizer

2023-01-12 Thread Justin King
On Fri, 9 Dec 2022 06:53:31 GMT, Justin King wrote: > Allow building OpenJDK with UBSan. Currently the build fails when optimizing > the image due to lots of undefined behavior (it invokes the built JVM). > Follow up PRs will either replace the undefined behavior with well defined > behavior

Re: RFR: 8299677: Formatter.format might take a long time to format an integer or floating-point [v4]

2023-01-12 Thread Raffaello Giulietti
On Wed, 11 Jan 2023 19:34:39 GMT, Raffaello Giulietti wrote: >> This change transforms a O(n^2) path to O(n) when prepending zero padding to >> decimal outputs, where n is the length of the padding. > > Raffaello Giulietti has updated the pull request incrementally with one > additional

Re: RFR: 8299677: Formatter.format might take a long time to format an integer or floating-point [v5]

2023-01-12 Thread Raffaello Giulietti
> This change transforms a O(n^2) path to O(n) when prepending zero padding to > decimal outputs, where n is the length of the padding. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: 8299677: Formatter.format might take a

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v5]

2023-01-12 Thread Archie L . Cobbs
On Thu, 12 Jan 2023 15:10:19 GMT, Maurizio Cimadamore wrote: > Interesting example - I thought you might have been referring to a case where > the class being analyzed was itself an exception. Yes - although that example doesn't compile (oops!). Just replace `catch (RuntimeException e)` with

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Archie L . Cobbs
On Thu, 12 Jan 2023 13:01:44 GMT, Maurizio Cimadamore wrote: >> Archie L. Cobbs has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - Use the more appropriate Type comparison method Types.isSameType(). >> - Add some more comments to

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v5]

2023-01-12 Thread Maurizio Cimadamore
On Thu, 12 Jan 2023 14:59:12 GMT, Archie L. Cobbs wrote: >>> * On the Java stack >>> (a) The current 'this' instance >>> (b) A method parameter >>> (c) A local variable >>> (d) A temporary value that is part of the current expression being >>> evaluated >>> (e) The return value from a

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v5]

2023-01-12 Thread Archie L . Cobbs
On Thu, 12 Jan 2023 09:57:00 GMT, Maurizio Cimadamore wrote: > I'm not sure what you mean by (1f). You mean this can be embedded in an > exception being thrown? Is that different from (2)? Yes, this would be a different case from any other that you'd have to handle in the code if you wanted

[jdk20] Integrated: 8299034: Runtime::exec clarification of inherited environment

2023-01-12 Thread Roger Riggs
On Wed, 11 Jan 2023 18:31:06 GMT, Roger Riggs wrote: > The current description of Runtime.exec, ProcessBuilder.start, and > ProcessBuilder.startPipeline identifies a minimum set of system dependent > environment variables needed to launch a process and allows additional system > dependent

Integrated: 8299978: Remove MethodHandleNatives.getMembers

2023-01-12 Thread Claes Redestad
On Wed, 11 Jan 2023 15:13:14 GMT, Claes Redestad wrote: > This removes `MethodHandleNatives.getMembers`, which has fallen into disuse. This pull request has now been integrated. Changeset: 48c8fb39 Author:Claes Redestad URL:

Re: RFR: 8299978: Remove MethodHandleNatives.getMembers

2023-01-12 Thread Claes Redestad
On Wed, 11 Jan 2023 15:13:14 GMT, Claes Redestad wrote: > This removes `MethodHandleNatives.getMembers`, which has fallen into disuse. Thanks for reviewing! - PR: https://git.openjdk.org/jdk/pull/11949

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Maurizio Cimadamore
On Wed, 11 Jan 2023 03:30:03 GMT, Archie L. Cobbs wrote: >> This PR adds a new lint warning category `this-escape`. >> >> It also adds `@SuppressWarnings` annotations as needed to the JDK itself to >> allow the JDK to continue to compile with `-Xlint:all`. >> >> A 'this' escape warning is

Re: RFR: 8294982: Implementation of Classfile API [v7]

2023-01-12 Thread Magnus Ihse Bursie
On Fri, 16 Dec 2022 18:22:24 GMT, Adam Sotona wrote: >> This is root pull request with Classfile API implementation, tests and >> benchmarks initial drop into JDK. >> >> Following pull requests consolidating JDK class files parsing, generating, >> and transforming >>

Re: RFR: 8294982: Implementation of Classfile API [v7]

2023-01-12 Thread Magnus Ihse Bursie
On Fri, 16 Dec 2022 18:22:24 GMT, Adam Sotona wrote: >> This is root pull request with Classfile API implementation, tests and >> benchmarks initial drop into JDK. >> >> Following pull requests consolidating JDK class files parsing, generating, >> and transforming >>

Re: RFR: JDK-8298448: UndefinedBehaviorSanitizer [v10]

2023-01-12 Thread Magnus Ihse Bursie
On Sat, 17 Dec 2022 06:39:48 GMT, Justin King wrote: >> Allow building OpenJDK with UBSan. Currently the build fails when optimizing >> the image due to lots of undefined behavior (it invokes the built JVM). >> Follow up PRs will either replace the undefined behavior with well defined >>

Re: RFR: 8299677: Formatter.format might take a long time to format an integer or floating-point [v4]

2023-01-12 Thread Lance Andersen
On Wed, 11 Jan 2023 19:34:39 GMT, Raffaello Giulietti wrote: >> This change transforms a O(n^2) path to O(n) when prepending zero padding to >> decimal outputs, where n is the length of the padding. > > Raffaello Giulietti has updated the pull request incrementally with one > additional

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Maurizio Cimadamore
On Wed, 11 Jan 2023 03:30:03 GMT, Archie L. Cobbs wrote: >> This PR adds a new lint warning category `this-escape`. >> >> It also adds `@SuppressWarnings` annotations as needed to the JDK itself to >> allow the JDK to continue to compile with `-Xlint:all`. >> >> A 'this' escape warning is

Re: RFR: 8299677: Formatter.format might take a long time to format an integer or floating-point [v4]

2023-01-12 Thread Lance Andersen
On Wed, 11 Jan 2023 19:34:39 GMT, Raffaello Giulietti wrote: >> This change transforms a O(n^2) path to O(n) when prepending zero padding to >> decimal outputs, where n is the length of the padding. > > Raffaello Giulietti has updated the pull request incrementally with one > additional

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v7]

2023-01-12 Thread Magnus Ihse Bursie
On Wed, 11 Jan 2023 03:30:03 GMT, Archie L. Cobbs wrote: >> This PR adds a new lint warning category `this-escape`. >> >> It also adds `@SuppressWarnings` annotations as needed to the JDK itself to >> allow the JDK to continue to compile with `-Xlint:all`. >> >> A 'this' escape warning is

Re: RFR: 8299677: Formatter.format might take a long time to format an integer or floating-point [v4]

2023-01-12 Thread Alan Bateman
On Wed, 11 Jan 2023 19:34:39 GMT, Raffaello Giulietti wrote: >> This change transforms a O(n^2) path to O(n) when prepending zero padding to >> decimal outputs, where n is the length of the padding. > > Raffaello Giulietti has updated the pull request incrementally with one > additional

Re: RFR: 8299677: Formatter.format might take a long time to format an integer or floating-point [v4]

2023-01-12 Thread Sergey Tsypanov
On Wed, 11 Jan 2023 19:34:39 GMT, Raffaello Giulietti wrote: >> This change transforms a O(n^2) path to O(n) when prepending zero padding to >> decimal outputs, where n is the length of the padding. > > Raffaello Giulietti has updated the pull request incrementally with one > additional

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v5]

2023-01-12 Thread Maurizio Cimadamore
On Thu, 12 Jan 2023 02:14:10 GMT, Archie L. Cobbs wrote: >>> >>> D'oh, you're right. But if you made `returnMe()` static or private then the >>> argument would still hold. >>> >>> > And, if the method is static, same story - you are passing ref3 somewhere >>> > else, and ref3 potentially

Re: RFR: 8299852: Modernize ConcurrentHashMap [v2]

2023-01-12 Thread Per Minborg
> `java.util.concurrent.ConcurrentHashMap` is relatively old and has not been > updated to reflect the current state of Java and can be modernized: > > * Add `@Serial` annotations > * Seal classes and restrict subclassing for internal classes > * Use pattern matching for instance > * Remove

Re: RFR: 8294982: Implementation of Classfile API [v7]

2023-01-12 Thread Adam Sotona
On Fri, 16 Dec 2022 18:22:24 GMT, Adam Sotona wrote: >> **This pull request is not intended for immediate integration to JDK >> mainline.** >> >> This is root pull request with Classfile API implementation, tests and >> benchmarks initial drop into JDK. >> >> Following pull requests

Re: RFR: 8299852: Modernize ConcurrentHashMap

2023-01-12 Thread ExE Boss
On Tue, 10 Jan 2023 10:32:34 GMT, Per Minborg wrote: > `java.util.concurrent.ConcurrentHashMap` is relatively old and has not been > updated to reflect the current state of Java and can be modernized: > > * Add `@Serial` annotations > * Seal classes and restrict subclassing for internal

Re: RFR: 8299513: Clean up java.io [v9]

2023-01-12 Thread Per Minborg
On Wed, 11 Jan 2023 15:31:22 GMT, Per Minborg wrote: >> Code in java.io contains many legacy constructs and semantics not >> recommended including: >> >> * C-style array declaration >> * Unnecessary visibility >> * Redundant keywords in interfaces (e.g. public, static) >> * Non-standard

[jdk20] Integrated: 8299439: java/text/Format/NumberFormat/CurrencyFormat.java fails for hr_HR

2023-01-12 Thread Christoph Langer
On Wed, 11 Jan 2023 09:21:18 GMT, Christoph Langer wrote: > Hi all, > > This pull request contains a backport of > [JDK-8299439](https://bugs.openjdk.org/browse/JDK-8299439), commit > [3b374c01](https://github.com/openjdk/jdk/commit/3b374c0153950ab193f3a188b57d3404b4ce2fe2) > from the

Re: [jdk20] RFR: 8299439: java/text/Format/NumberFormat/CurrencyFormat.java fails for hr_HR

2023-01-12 Thread Christoph Langer
On Wed, 11 Jan 2023 17:01:26 GMT, Naoto Sato wrote: >> Hi all, >> >> This pull request contains a backport of >> [JDK-8299439](https://bugs.openjdk.org/browse/JDK-8299439), commit >> [3b374c01](https://github.com/openjdk/jdk/commit/3b374c0153950ab193f3a188b57d3404b4ce2fe2) >> from the