This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new 464932e49c Reapply "Avoid potential NPE"
464932e49c is described below

commit 464932e49cf9e38f337bfa9d42d3f10cbc430633
Author: Daniel Sun <[email protected]>
AuthorDate: Sun Dec 29 19:40:33 2024 +0900

    Reapply "Avoid potential NPE"
    
    This reverts commit f024f73a74b6b59dafbabd11df5310fba60360f2.
---
 .../src/main/groovy/groovy/jmx/builder/JmxMetaMapBuilder.groovy         | 2 +-
 .../src/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 38950e5978..f53de42889 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 0e08631280..893cab1ae0 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)
                 }

Reply via email to