Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to JDK 11 and Java 11 syntax [part 1] #698

Merged
merged 27 commits into from
Dec 10, 2021
Merged

Migrate to JDK 11 and Java 11 syntax [part 1] #698

merged 27 commits into from
Dec 10, 2021

Conversation

armiol
Copy link
Collaborator

@armiol armiol commented Dec 8, 2021

This changeset is the first part of the migration to Java 11.

  • switches the project to JDK 11 and Java 11 in source/target level for Java files;
  • uses vars instead of explicit types — this is done for the part of the source files;
  • removes the Error Prone plugin from the "unit" test sources — in order to avoid the fatal compiler error;
  • removes the unused code.

In scope of this changeset, a lot of "unused" endpoints were discovered. See #699 on this matter.

The library version is set to 2.0.0-SNAPSHOT.78.

@armiol armiol self-assigned this Dec 8, 2021
@armiol armiol changed the title Migrate to JDK 11 and Java 11 syntax Migrate to JDK 11 and Java 11 syntax [part 1] Dec 8, 2021
@codecov
Copy link

codecov bot commented Dec 8, 2021

Codecov Report

Merging #698 (b0b3737) into master (f24c8bc) will decrease coverage by 0.10%.
The diff coverage is 81.23%.

@@             Coverage Diff              @@
##             master     #698      +/-   ##
============================================
- Coverage     78.78%   78.67%   -0.11%     
+ Complexity     1756     1753       -3     
============================================
  Files           247      247              
  Lines          5868     5777      -91     
  Branches        433      433              
============================================
- Hits           4623     4545      -78     
+ Misses         1072     1058      -14     
- Partials        173      174       +1     


workingDir(this@npm)
commandLine(npmExecutable)
args(*args)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SpreadOperator: In most cases using a spread operator causes a full copy of the array to be created before calling a method which has a very high performance penalty.
(at-me in a reply with help or ignore)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sonatype-lift ignore

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've recorded this as ignored for this pull request. If you change your mind, just comment @sonatype-lift unignore.

@armiol armiol marked this pull request as ready for review December 9, 2021 17:56
@armiol armiol requested a review from a team December 9, 2021 18:00
Copy link
Contributor

@alexander-yevsyukov alexander-yevsyukov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@dmdashenkov dmdashenkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a couple of comments.
Also, what did you do to make GitHub show buildSrc/ changes at the end rather than at the start? This makes browsing the files in GitHub waaay easier.

PackageInfo newNode = PackageInfo.of(current);
final var current = first;
var directParent = graph.nodes().stream()
.filter((node) -> IsDirectParent.of(current)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please extract IsDirectParent.of(current) from the lambda. Also, there is something strange going on with the renaming first to current. Maybe, we could get rid of that as well.

Comment on lines 48 to 50
var unslashed = matcher.find() ?
matcher.replaceAll(BACKSLASH + matcher.group()) :
stringToQuote;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we usually put the ? and the : on the following lines?
I remember that because it does not work in Groovy, we had to use the other format (the one used in this snippet).

@armiol armiol merged commit 9aa41e1 into master Dec 10, 2021
@armiol armiol deleted the migrate-jdk-11 branch December 10, 2021 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants