From 8ca12ea798bc0ddd7adefed9c2b50db25b3707aa Mon Sep 17 00:00:00 2001 From: Daniel Sun Date: Sat, 4 Jan 2025 01:17:35 +0900 Subject: [PATCH] Revert "Avoid potential NPE" This reverts commit 467e317561fe667e5838fda7cdc118cb2f2d73d6. --- .../src/main/groovy/groovy/jmx/builder/JmxMetaMapBuilder.groovy | 2 +- .../main/groovy/groovy/typecheckers/FormatStringChecker.groovy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/subprojects/groovy-jmx/src/main/groovy/groovy/jmx/builder/JmxMetaMapBuilder.groovy b/subprojects/groovy-jmx/src/main/groovy/groovy/jmx/builder/JmxMetaMapBuilder.groovy index f53de42889e..38950e59785 100644 --- a/subprojects/groovy-jmx/src/main/groovy/groovy/jmx/builder/JmxMetaMapBuilder.groovy +++ b/subprojects/groovy-jmx/src/main/groovy/groovy/jmx/builder/JmxMetaMapBuilder.groovy @@ -467,7 +467,7 @@ class JmxMetaMapBuilder { if (descriptor && descriptor instanceof Map) { // foo:[params:["paramTypeName0":[name:"",desc:""], paramTypeNameN[:]]] if (descriptor.params && descriptor.params instanceof Map) { - params = descriptor?.params?.keySet()?.toList() + params = descriptor?.params.keySet().toList() } // foo:[params:["paramTypeName0",...,"paramTypeNameN"]] if (descriptor.params && descriptor.params instanceof List) { diff --git a/subprojects/groovy-typecheckers/src/main/groovy/groovy/typecheckers/FormatStringChecker.groovy b/subprojects/groovy-typecheckers/src/main/groovy/groovy/typecheckers/FormatStringChecker.groovy index 893cab1ae00..0e086312805 100644 --- a/subprojects/groovy-typecheckers/src/main/groovy/groovy/typecheckers/FormatStringChecker.groovy +++ b/subprojects/groovy-typecheckers/src/main/groovy/groovy/typecheckers/FormatStringChecker.groovy @@ -255,7 +255,7 @@ class FormatStringChecker extends GroovyTypeCheckingExtensionSupport.TypeCheckin } void checkBadFlags(flagList, conversion, Expression target, String badFlags) { - def mismatched = flagList?.findAll { badFlags.contains(it) }?.join() + def mismatched = flagList?.findAll { badFlags.contains(it) }.join() if (mismatched) { addStaticTypeError("FormatFlagsConversionMismatch: Conversion = $conversion, Flags = '$mismatched'", target) }