This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-bcel.git
commit c032ef5d7db20640d8cd4847df4d46081842f338 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Mon Apr 1 11:30:20 2024 -0400 Avoid NullPointerException calling org.apache.bcel.generic.MethodGen.setArgumentNames(String[]) with null --- src/changes/changes.xml | 1 + src/main/java/org/apache/bcel/generic/MethodGen.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 7004873e..28970421 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -93,6 +93,7 @@ The <action> type attribute can be add,update,fix,remove. <action type="update" dev="ggregory" due-to="Gary Gregory">Avoid NullPointerException calling org.apache.bcel.generic.InstructionList.redirectExceptionHandlers(CodeExceptionGen[], InstructionHandle, InstructionHandle) with null.</action> <action type="update" dev="ggregory" due-to="Gary Gregory">Avoid NullPointerException calling org.apache.bcel.generic.InstructionList.findHandle(InstructionHandle[], int[], int, int) with null.</action> <action type="update" dev="ggregory" due-to="Gary Gregory">Avoid NullPointerException calling org.apache.bcel.generic.MethodGen.setArgumentTypes(Type[]) with null.</action> + <action type="update" dev="ggregory" due-to="Gary Gregory">Avoid NullPointerException calling org.apache.bcel.generic.MethodGen.setArgumentNames(String[]) with null.</action> <!-- UPDATE --> <action type="update" dev="ggregory" due-to="Dependabot">Bump org.apache.commons:commons-parent from 66 to 67 #283.</action> <action type="update" dev="ggregory" due-to="Dependabot">Bump org.jetbrains.kotlin:kotlin-stdlib from 1.9.22 to 1.9.23 #284.</action> diff --git a/src/main/java/org/apache/bcel/generic/MethodGen.java b/src/main/java/org/apache/bcel/generic/MethodGen.java index 37e21679..b93400f8 100644 --- a/src/main/java/org/apache/bcel/generic/MethodGen.java +++ b/src/main/java/org/apache/bcel/generic/MethodGen.java @@ -1034,7 +1034,7 @@ public class MethodGen extends FieldGenOrMethodGen { } public void setArgumentNames(final String[] argNames) { - this.argNames = argNames; + this.argNames = ArrayUtils.nullToEmpty(argNames); } public void setArgumentType(final int i, final Type type) {