Integrated: 8233269: Improve handling of JAVA_ARGS

2022-06-01 Thread Adam Sotona
On Wed, 1 Jun 2022 13:52:46 GMT, Adam Sotona  wrote:

> LauncherCommon.gmk is unfortunately defining JAVA_ARGS with `-J-ms8m` option 
> for all JDK launchers, including java launcher.
> JAVA_ARGS  should not be defined for java launcher (in contrast to the other 
> JDK launchers), and the command line option `-J-ms8m` is obsolete for java 
> launcher.
> 
> Proposed patch removes JAVA_ARGS from java launcher, while keeping status quo 
> for all other JDK launchers.
> The patch of LauncherCommon.gmk identifies java launcher by undefined 
> MAIN_CLASS.
> 
> Thanks for review,
> Adam

This pull request has now been integrated.

Changeset: a82417fa
Author:Adam Sotona 
URL:   
https://git.openjdk.java.net/jdk/commit/a82417fa190a132313f6734a75f1998858c164fd
Stats: 8 lines in 1 file changed: 4 ins; 1 del; 3 mod

8233269: Improve handling of JAVA_ARGS

Reviewed-by: erikj

-

PR: https://git.openjdk.java.net/jdk/pull/8972


RFR: 8233269: Improve handling of JAVA_ARGS

2022-06-01 Thread Adam Sotona
LauncherCommon.gmk is unfortunately defining JAVA_ARGS with `-J-ms8m` option 
for all JDK launchers, including java launcher.
JAVA_ARGS  should not be defined for java launcher (in contrast to the other 
JDK launchers), and the command line option `-J-ms8m` is obsolete for java 
launcher.

Proposed patch removes JAVA_ARGS from java launcher, while keeping status quo 
for all other JDK launchers.
The patch of LauncherCommon.gmk identifies java launcher by undefined 
MAIN_CLASS.

Thanks for review,
Adam

-

Commit messages:
 - 8233269: Improve handling of JAVA_ARGS

Changes: https://git.openjdk.java.net/jdk/pull/8972/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=8972&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8233269
  Stats: 8 lines in 1 file changed: 4 ins; 1 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8972.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8972/head:pull/8972

PR: https://git.openjdk.java.net/jdk/pull/8972


Re: RFR: 8244681: Add a warning for possibly lossy conversion in compound assignments [v10]

2022-05-23 Thread Adam Sotona
> Please review this patch adding new lint option, **lossy-conversions**, to 
> javac to warn about type casts in compound assignments with possible lossy 
> conversions.
> 
> The new lint warning is shown if the type of the right-hand operand of a 
> compound assignment is not assignment compatible with the type of the 
> variable.
> 
> The implementation of the warning is based on similar check performed to emit 
> "possible lossy conversion" compilation error for simple assignments. 
> 
> Proposed patch also include complex matrix-style test with positive and 
> negative test cases of lossy conversions in compound assignments.
> 
> Proposed patch also disables this new lint option in all affected JDK modules 
> and libraries to allow smooth JDK build. Individual cases to address possibly 
> lossy conversions warnings in JDK are already addressed in a separate 
> umbrella issue and its sub-tasks.
> 
> Thanks for your review,
> Adam

Adam Sotona has updated the pull request incrementally with two additional 
commits since the last revision:

 - re-enabled lossy-conversion javac warnings in JDK Build Tools and 
jdk.compiler module
 - Added man-page line about lossy-conversion lint

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8599/files
  - new: https://git.openjdk.java.net/jdk/pull/8599/files/455720ef..4978c2a6

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=8599&range=09
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=8599&range=08-09

  Stats: 5 lines in 3 files changed: 3 ins; 1 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8599.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8599/head:pull/8599

PR: https://git.openjdk.java.net/jdk/pull/8599


Re: RFR: 8244681: Add a warning for possibly lossy conversion in compound assignments [v9]

2022-05-23 Thread Adam Sotona
> Please review this patch adding new lint option, **lossy-conversions**, to 
> javac to warn about type casts in compound assignments with possible lossy 
> conversions.
> 
> The new lint warning is shown if the type of the right-hand operand of a 
> compound assignment is not assignment compatible with the type of the 
> variable.
> 
> The implementation of the warning is based on similar check performed to emit 
> "possible lossy conversion" compilation error for simple assignments. 
> 
> Proposed patch also include complex matrix-style test with positive and 
> negative test cases of lossy conversions in compound assignments.
> 
> Proposed patch also disables this new lint option in all affected JDK modules 
> and libraries to allow smooth JDK build. Individual cases to address possibly 
> lossy conversions warnings in JDK are already addressed in a separate 
> umbrella issue and its sub-tasks.
> 
> Thanks for your review,
> Adam

Adam Sotona has updated the pull request with a new target base due to a merge 
or a rebase. The pull request now contains 12 commits:

 - Merge branch 'openjdk:master' into JDK-8244681
 - 8244681: Add a warning for possibly lossy conversion in compound assignments
   re-enabled warnings for java.base, java.rmi and java.smartcardio
 - Merge branch 'openjdk:master' into JDK-8244681
 - lossy conversions addressed in java.net.http, jdk.incubator.foreign, 
Microbenchmarks and most of java.base
   new case appeared in java.base by moving jdk.incubator.foreign code under 
java.base
 - Merge remote-tracking branch 'upstream/master' into JDK-8244681
   
   # Conflicts:
   #make/test/BuildMicrobenchmark.gmk
 - enabled lossy-conversions warnings for jdk.jfr and jdk.management.jfr
 - Merge branch 'openjdk:master' into JDK-8244681
 - 8244681: Add a warning for possibly lossy conversion in compound assignments
   recommended correction of the warning description
 - 8244681: Add a warning for possibly lossy conversion in compound assignments
   recommended correction of the warning wording
   fixed typo in test method name
 - Merge branch 'openjdk:master' into JDK-8244681
 - ... and 2 more: https://git.openjdk.java.net/jdk/compare/c9065915...455720ef

-

Changes: https://git.openjdk.java.net/jdk/pull/8599/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=8599&range=08
  Stats: 441 lines in 18 files changed: 438 ins; 0 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8599.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8599/head:pull/8599

PR: https://git.openjdk.java.net/jdk/pull/8599


Re: RFR: 8244681: Add a warning for possibly lossy conversion in compound assignments [v8]

2022-05-16 Thread Adam Sotona
> Please review this patch adding new lint option, **lossy-conversions**, to 
> javac to warn about type casts in compound assignments with possible lossy 
> conversions.
> 
> The new lint warning is shown if the type of the right-hand operand of a 
> compound assignment is not assignment compatible with the type of the 
> variable.
> 
> The implementation of the warning is based on similar check performed to emit 
> "possible lossy conversion" compilation error for simple assignments. 
> 
> Proposed patch also include complex matrix-style test with positive and 
> negative test cases of lossy conversions in compound assignments.
> 
> Proposed patch also disables this new lint option in all affected JDK modules 
> and libraries to allow smooth JDK build. Individual cases to address possibly 
> lossy conversions warnings in JDK are already addressed in a separate 
> umbrella issue and its sub-tasks.
> 
> Thanks for your review,
> Adam

Adam Sotona has updated the pull request incrementally with one additional 
commit since the last revision:

  8244681: Add a warning for possibly lossy conversion in compound assignments
  re-enabled warnings for java.base, java.rmi and java.smartcardio

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8599/files
  - new: https://git.openjdk.java.net/jdk/pull/8599/files/a72644e9..74f9f4b1

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=8599&range=07
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=8599&range=06-07

  Stats: 3 lines in 3 files changed: 0 ins; 3 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8599.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8599/head:pull/8599

PR: https://git.openjdk.java.net/jdk/pull/8599


Re: RFR: 8244681: Add a warning for possibly lossy conversion in compound assignments [v7]

2022-05-16 Thread Adam Sotona
> Please review this patch adding new lint option, **lossy-conversions**, to 
> javac to warn about type casts in compound assignments with possible lossy 
> conversions.
> 
> The new lint warning is shown if the type of the right-hand operand of a 
> compound assignment is not assignment compatible with the type of the 
> variable.
> 
> The implementation of the warning is based on similar check performed to emit 
> "possible lossy conversion" compilation error for simple assignments. 
> 
> Proposed patch also include complex matrix-style test with positive and 
> negative test cases of lossy conversions in compound assignments.
> 
> Proposed patch also disables this new lint option in all affected JDK modules 
> and libraries to allow smooth JDK build. Individual cases to address possibly 
> lossy conversions warnings in JDK are already addressed in a separate 
> umbrella issue and its sub-tasks.
> 
> Thanks for your review,
> Adam

Adam Sotona has updated the pull request with a new target base due to a merge 
or a rebase. The pull request now contains 10 commits:

 - Merge branch 'openjdk:master' into JDK-8244681
 - lossy conversions addressed in java.net.http, jdk.incubator.foreign, 
Microbenchmarks and most of java.base
   new case appeared in java.base by moving jdk.incubator.foreign code under 
java.base
 - Merge remote-tracking branch 'upstream/master' into JDK-8244681
   
   # Conflicts:
   #make/test/BuildMicrobenchmark.gmk
 - enabled lossy-conversions warnings for jdk.jfr and jdk.management.jfr
 - Merge branch 'openjdk:master' into JDK-8244681
 - 8244681: Add a warning for possibly lossy conversion in compound assignments
   recommended correction of the warning description
 - 8244681: Add a warning for possibly lossy conversion in compound assignments
   recommended correction of the warning wording
   fixed typo in test method name
 - Merge branch 'openjdk:master' into JDK-8244681
 - 8244681: Add a warning for possibly lossy conversion in compound assignments
   jdk.internal.le make patch to disable warnings
 - 8244681: Add a warning for possibly lossy conversion in compound assignments

-

Changes: https://git.openjdk.java.net/jdk/pull/8599/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=8599&range=06
  Stats: 444 lines in 21 files changed: 441 ins; 0 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8599.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8599/head:pull/8599

PR: https://git.openjdk.java.net/jdk/pull/8599


Re: RFR: 8244681: Add a warning for possibly lossy conversion in compound assignments [v6]

2022-05-13 Thread Adam Sotona
> Please review this patch adding new lint option, **lossy-conversions**, to 
> javac to warn about type casts in compound assignments with possible lossy 
> conversions.
> 
> The new lint warning is shown if the type of the right-hand operand of a 
> compound assignment is not assignment compatible with the type of the 
> variable.
> 
> The implementation of the warning is based on similar check performed to emit 
> "possible lossy conversion" compilation error for simple assignments. 
> 
> Proposed patch also include complex matrix-style test with positive and 
> negative test cases of lossy conversions in compound assignments.
> 
> Proposed patch also disables this new lint option in all affected JDK modules 
> and libraries to allow smooth JDK build. Individual cases to address possibly 
> lossy conversions warnings in JDK are already addressed in a separate 
> umbrella issue and its sub-tasks.
> 
> Thanks for your review,
> Adam

Adam Sotona has updated the pull request with a new target base due to a merge 
or a rebase. The pull request now contains ten commits:

 - lossy conversions addressed in java.net.http, jdk.incubator.foreign, 
Microbenchmarks and most of java.base
   new case appeared in java.base by moving jdk.incubator.foreign code under 
java.base
 - Merge remote-tracking branch 'upstream/master' into JDK-8244681
   
   # Conflicts:
   #make/test/BuildMicrobenchmark.gmk
 - enabled lossy-conversions warnings for jdk.jfr and jdk.management.jfr
 - Merge branch 'openjdk:master' into JDK-8244681
 - 8244681: Add a warning for possibly lossy conversion in compound assignments
   recommended correction of the warning description
 - 8244681: Add a warning for possibly lossy conversion in compound assignments
   recommended correction of the warning wording
   fixed typo in test method name
 - Merge branch 'openjdk:master' into JDK-8244681
 - 8244681: Add a warning for possibly lossy conversion in compound assignments
   jdk.internal.le make patch to disable warnings
 - 8244681: Add a warning for possibly lossy conversion in compound assignments

-

Changes: https://git.openjdk.java.net/jdk/pull/8599/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=8599&range=05
  Stats: 444 lines in 21 files changed: 441 ins; 0 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8599.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8599/head:pull/8599

PR: https://git.openjdk.java.net/jdk/pull/8599


Re: RFR: 8244681: Add a warning for possibly lossy conversion in compound assignments [v5]

2022-05-11 Thread Adam Sotona
> Please review this patch adding new lint option, **lossy-conversions**, to 
> javac to warn about type casts in compound assignments with possible lossy 
> conversions.
> 
> The new lint warning is shown if the type of the right-hand operand of a 
> compound assignment is not assignment compatible with the type of the 
> variable.
> 
> The implementation of the warning is based on similar check performed to emit 
> "possible lossy conversion" compilation error for simple assignments. 
> 
> Proposed patch also include complex matrix-style test with positive and 
> negative test cases of lossy conversions in compound assignments.
> 
> Proposed patch also disables this new lint option in all affected JDK modules 
> and libraries to allow smooth JDK build. Individual cases to address possibly 
> lossy conversions warnings in JDK are already addressed in a separate 
> umbrella issue and its sub-tasks.
> 
> Thanks for your review,
> Adam

Adam Sotona has updated the pull request incrementally with one additional 
commit since the last revision:

  enabled lossy-conversions warnings for jdk.jfr and jdk.management.jfr

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8599/files
  - new: https://git.openjdk.java.net/jdk/pull/8599/files/a59dfa4f..32282515

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=8599&range=04
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=8599&range=03-04

  Stats: 2 lines in 2 files changed: 0 ins; 1 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8599.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8599/head:pull/8599

PR: https://git.openjdk.java.net/jdk/pull/8599


Re: RFR: 8244681: Add a warning for possibly lossy conversion in compound assignments [v3]

2022-05-11 Thread Adam Sotona
On Wed, 11 May 2022 13:31:16 GMT, Roger Riggs  wrote:

>> Thanks for quick reaction.
>> I'll keep my eyes on this race of patches and update this pull request 
>> accordingly or create a new PR.
>
> I put out a PR for java.base, but thought I'd wait until the javac fixe were 
> pushed before integrating and would re-enable the warnings at the same time.

Feel free to go ahead with the java.base PR as this one still needs CSR.

-

PR: https://git.openjdk.java.net/jdk/pull/8599


Re: RFR: 8244681: Add a warning for possibly lossy conversion in compound assignments [v4]

2022-05-11 Thread Adam Sotona
> Please review this patch adding new lint option, **lossy-conversions**, to 
> javac to warn about type casts in compound assignments with possible lossy 
> conversions.
> 
> The new lint warning is shown if the type of the right-hand operand of a 
> compound assignment is not assignment compatible with the type of the 
> variable.
> 
> The implementation of the warning is based on similar check performed to emit 
> "possible lossy conversion" compilation error for simple assignments. 
> 
> Proposed patch also include complex matrix-style test with positive and 
> negative test cases of lossy conversions in compound assignments.
> 
> Proposed patch also disables this new lint option in all affected JDK modules 
> and libraries to allow smooth JDK build. Individual cases to address possibly 
> lossy conversions warnings in JDK are already addressed in a separate 
> umbrella issue and its sub-tasks.
> 
> Thanks for your review,
> Adam

Adam Sotona has updated the pull request with a new target base due to a merge 
or a rebase. The incremental webrev excludes the unrelated changes brought in 
by the merge/rebase. The pull request contains six additional commits since the 
last revision:

 - Merge branch 'openjdk:master' into JDK-8244681
 - 8244681: Add a warning for possibly lossy conversion in compound assignments
   recommended correction of the warning description
 - 8244681: Add a warning for possibly lossy conversion in compound assignments
   recommended correction of the warning wording
   fixed typo in test method name
 - Merge branch 'openjdk:master' into JDK-8244681
 - 8244681: Add a warning for possibly lossy conversion in compound assignments
   jdk.internal.le make patch to disable warnings
 - 8244681: Add a warning for possibly lossy conversion in compound assignments

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8599/files
  - new: https://git.openjdk.java.net/jdk/pull/8599/files/f0729396..a59dfa4f

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=8599&range=03
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=8599&range=02-03

  Stats: 9179 lines in 255 files changed: 5253 ins; 2422 del; 1504 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8599.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8599/head:pull/8599

PR: https://git.openjdk.java.net/jdk/pull/8599


Re: RFR: 8244681: Add a warning for possibly lossy conversion in compound assignments [v3]

2022-05-11 Thread Adam Sotona
On Wed, 11 May 2022 13:10:10 GMT, Magnus Ihse Bursie  wrote:

>> I agree, but if it doesn't happen, I can follow up with a separate PR where 
>> I remove the disablement.
>
> That's good to know. I think the tricky part is mostly about keeping track of 
> all these disabled warnings, so they are not kept around longer than 
> necessary. And that needs coordination with all the subtasks of the umbrella 
> issue.

Thanks for quick reaction.
I'll keep my eyes on this race of patches and update this pull request 
accordingly or create a new PR.

-

PR: https://git.openjdk.java.net/jdk/pull/8599


Re: RFR: 8244681: Add a warning for possibly lossy conversion in compound assignments [v3]

2022-05-11 Thread Adam Sotona
> Please review this patch adding new lint option, **lossy-conversions**, to 
> javac to warn about type casts in compound assignments with possible lossy 
> conversions.
> 
> The new lint warning is shown if the type of the right-hand operand of a 
> compound assignment is not assignment compatible with the type of the 
> variable.
> 
> The implementation of the warning is based on similar check performed to emit 
> "possible lossy conversion" compilation error for simple assignments. 
> 
> Proposed patch also include complex matrix-style test with positive and 
> negative test cases of lossy conversions in compound assignments.
> 
> Proposed patch also disables this new lint option in all affected JDK modules 
> and libraries to allow smooth JDK build. Individual cases to address possibly 
> lossy conversions warnings in JDK are already addressed in a separate 
> umbrella issue and its sub-tasks.
> 
> Thanks for your review,
> Adam

Adam Sotona has updated the pull request incrementally with one additional 
commit since the last revision:

  8244681: Add a warning for possibly lossy conversion in compound assignments
  recommended correction of the warning description

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8599/files
  - new: https://git.openjdk.java.net/jdk/pull/8599/files/6b3942b8..f0729396

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=8599&range=02
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=8599&range=01-02

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8599.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8599/head:pull/8599

PR: https://git.openjdk.java.net/jdk/pull/8599


Re: RFR: 8244681: Add a warning for possibly lossy conversion in compound assignments [v2]

2022-05-10 Thread Adam Sotona
> Please review this patch adding new lint option, **lossy-conversions**, to 
> javac to warn about type casts in compound assignments with possible lossy 
> conversions.
> 
> The new lint warning is shown if the type of the right-hand operand of a 
> compound assignment is not assignment compatible with the type of the 
> variable.
> 
> The implementation of the warning is based on similar check performed to emit 
> "possible lossy conversion" compilation error for simple assignments. 
> 
> Proposed patch also include complex matrix-style test with positive and 
> negative test cases of lossy conversions in compound assignments.
> 
> Proposed patch also disables this new lint option in all affected JDK modules 
> and libraries to allow smooth JDK build. Individual cases to address possibly 
> lossy conversions warnings in JDK are already addressed in a separate 
> umbrella issue and its sub-tasks.
> 
> Thanks for your review,
> Adam

Adam Sotona has updated the pull request incrementally with one additional 
commit since the last revision:

  8244681: Add a warning for possibly lossy conversion in compound assignments
  recommended correction of the warning wording
  fixed typo in test method name

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8599/files
  - new: https://git.openjdk.java.net/jdk/pull/8599/files/47779ba5..6b3942b8

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=8599&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=8599&range=00-01

  Stats: 2 lines in 2 files changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8599.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8599/head:pull/8599

PR: https://git.openjdk.java.net/jdk/pull/8599


Re: RFR: 8244681: Add a warning for possibly lossy conversion in compound assignments

2022-05-10 Thread Adam Sotona
On Mon, 9 May 2022 15:56:35 GMT, Adam Sotona  wrote:

> Please review this patch adding new lint option, **lossy-conversions**, to 
> javac to warn about type casts in compound assignments with possible lossy 
> conversions.
> 
> The new lint warning is shown if the type of the right-hand operand of a 
> compound assignment is not assignment compatible with the type of the 
> variable.
> 
> The implementation of the warning is based on similar check performed to emit 
> "possible lossy conversion" compilation error for simple assignments. 
> 
> Proposed patch also include complex matrix-style test with positive and 
> negative test cases of lossy conversions in compound assignments.
> 
> Proposed patch also disables this new lint option in all affected JDK modules 
> and libraries to allow smooth JDK build. Individual cases to address possibly 
> lossy conversions warnings in JDK are already addressed in a separate 
> umbrella issue and its sub-tasks.
> 
> Thanks for your review,
> Adam

I agree with the priority to keep java.base and java.desktop clean from 
possibly lossy conversions, so the related issues should probably raise from P4 
priority level.

However this lint warning as a part of the javac is critical to confirm that 
the situations have been correctly addressed.
If we want to avoid "blind" patching, we only two possible scenarios:
1. big homogenous patch including hundreds of fixed lines of code across many 
"moving-target" classes, together with lint warning implemented and enabled 
2. javac lint patch (disabled for affected JDK modules build) goes first, so 
each case can be resolved, reviewed and validated in individual patch 

>From complexity and cost perspective I prefer the second scenario.

-

PR: https://git.openjdk.java.net/jdk/pull/8599


RFR: 8244681: Add a warning for possibly lossy conversion in compound assignments

2022-05-09 Thread Adam Sotona
Please review this patch adding new lint option, **lossy-conversions**, to 
javac to warn about type casts in compound assignments with possible lossy 
conversions.

The new lint warning is shown if the type of the right-hand operand of a 
compound assignment is not assignment compatible with the type of the variable.

The implementation of the warning is based on similar check performed to emit 
"possible lossy conversion" compilation error for simple assignments. 

Proposed patch also include complex matrix-style test with positive and 
negative test cases of lossy conversions in compound assignments.

Proposed patch also disables this new lint option in all affected JDK modules 
and libraries to allow smooth JDK build. Individual cases to address possibly 
lossy conversions warnings in JDK are already addressed in a separate umbrella 
issue and its sub-tasks.

Thanks for your review,
Adam

-

Commit messages:
 - Merge branch 'openjdk:master' into JDK-8244681
 - 8244681: Add a warning for possibly lossy conversion in compound assignments
 - 8244681: Add a warning for possibly lossy conversion in compound assignments

Changes: https://git.openjdk.java.net/jdk/pull/8599/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=8599&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8244681
  Stats: 449 lines in 26 files changed: 444 ins; 0 del; 5 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8599.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8599/head:pull/8599

PR: https://git.openjdk.java.net/jdk/pull/8599


RFR: 8264485: build.tools.depend.Depend.toString(byte[]) creates malformed hex strings

2021-11-30 Thread Adam Sotona
make/jdk/src/classes/build/tools/depend/Depend.java method toString(byte[]) 
constructs hex string out of the given byte array.
Actual implementation is using custom conversion code, which does not pad byte 
values <16 with leading zero.
Resulting hex string is invalid and for example sequence of bytes 1 and 0 
generates the same hex string as a single byte 16.

Proposed patch is delegating hex conversion to java.util.HexFormat instead.

Thanks,
Adam

-

Commit messages:
 - 8264485: build.tools.depend.Depend.toString(byte[]) creates malformed hex 
strings

Changes: https://git.openjdk.java.net/jdk/pull/6610/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=6610&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8264485
  Stats: 8 lines in 1 file changed: 1 ins; 6 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/6610.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/6610/head:pull/6610

PR: https://git.openjdk.java.net/jdk/pull/6610