Skip to content

Commit

Permalink
don't use last as extension method
Browse files Browse the repository at this point in the history
because in Java 21
getLast() has been introduced, throwing NoSuchElementException
instead of returning null
  • Loading branch information
LorenzoBettini committed May 14, 2024
1 parent a64804a commit f5a59f0
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ class XbaseFormatter extends XtypeFormatter {
}

def protected XClosure builder(List<XExpression> params) {
// don't use last (now deprecated) because in Java 21
// getLast() has been introduced, throwing NoSuchElementException
// instead of returning null
if (params.lastOrNull !== null) {
val grammarElement = params.lastOrNull.grammarElement
if (grammarElement == XMemberFeatureCallAccess.memberCallArgumentsXClosureParserRuleCall_1_1_4_0 ||
Expand Down

0 comments on commit f5a59f0

Please sign in to comment.