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

Run recent JDK tests on JDK 21 #834

Merged
merged 7 commits into from
Sep 28, 2023
Merged

Conversation

armughan11
Copy link
Collaborator

@armughan11 armughan11 commented Sep 28, 2023

Added test for null case in switch statements (covering #831) and changed JDK 17 to JDK 21 for testing recent language features

Added test for null case (covering uber#831) and changed JDK 17 to JDK 21 for unit testing
Changed module name
@codecov
Copy link

codecov bot commented Sep 28, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (ab387b9) 86.75% compared to head (f65a1c0) 86.75%.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #834   +/-   ##
=========================================
  Coverage     86.75%   86.75%           
  Complexity     1870     1870           
=========================================
  Files            74       74           
  Lines          6178     6178           
  Branches       1202     1202           
=========================================
  Hits           5360     5360           
  Misses          407      407           
  Partials        411      411           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@msridhar msridhar left a comment

Choose a reason for hiding this comment

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

Thanks for this! Couple comments

@@ -174,4 +175,30 @@ public void testSwitchExprLambda() {
"}")
.doTest();
}

@Ignore
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add a comment indicating we are ignoring because of a crash in the dataflow library

" a,",
" b,",
" }",
" // NOTE: we should report a bug here for nullableEnum but cannot do so until",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Actually thinking more this is not true; if there is case null then there is no NPE. Can you confirm?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

case null is crashing the code right now, so I can't really check. But without case null it should report a NPE, which it doesn't. I could probably have two switch statements one with null and one without and then get this documented.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm saying that NullAway should not report an NPE here, because there will be no NPE if case null is present. See here. You only get an NPE if there is no case null case.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's correct, I misunderstood your comment. I added the comment for NullAway not reporting without null, as we discussed previously, but in this context i can either omit it entirely or mention that it only applies when null case isn't defined.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, I misunderstood before. I went ahead and deleted the comment.

@armughan11 armughan11 requested a review from msridhar September 28, 2023 15:20
Copy link
Collaborator

@msridhar msridhar left a comment

Choose a reason for hiding this comment

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

Thanks again for this fix!

@msridhar msridhar changed the title Prepare for JDK 21 Run recent JDK tests on JDK 21 Sep 28, 2023
@msridhar msridhar enabled auto-merge (squash) September 28, 2023 16:28
@msridhar msridhar disabled auto-merge September 28, 2023 16:28
@msridhar msridhar merged commit d04828a into uber:master Sep 28, 2023
9 checks passed
msridhar added a commit that referenced this pull request Sep 28, 2023
We need some version of JDK 21 installed now (after #834) for the
snapshot job to succeed, even though it's not used. Take the opportunity
to simplify other usage of `setup-java`.
@armughan11 armughan11 deleted the jdk-21-prep branch June 3, 2024 02:02
@armughan11 armughan11 restored the jdk-21-prep branch June 3, 2024 02:02
@armughan11 armughan11 deleted the jdk-21-prep branch June 3, 2024 02:04
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.

2 participants