Skip to content

Commit

Permalink
Mark parameters that can be null as maybe null.
Browse files Browse the repository at this point in the history
  • Loading branch information
raphw committed Dec 17, 2021
1 parent d597bbb commit c73549d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Expand Up @@ -684,7 +684,7 @@ public Composable setsDefaultValue() {
/**
* {@inheritDoc}
*/
public Composable setsValue(Object value) {
public Composable setsValue(@MaybeNull Object value) {
if (value == null) {
return setsDefaultValue();
}
Expand Down
Expand Up @@ -43,6 +43,7 @@
import net.bytebuddy.utility.JavaConstant;
import net.bytebuddy.utility.JavaType;
import net.bytebuddy.utility.RandomString;
import net.bytebuddy.utility.nullability.MaybeNull;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;

Expand Down Expand Up @@ -1822,7 +1823,7 @@ public ForStackManipulation(StackManipulation stackManipulation, TypeDefinition
* @param value The value to load as an argument or {@code null}.
* @return An appropriate argument loader.
*/
public static ArgumentLoader.Factory of(Object value) {
public static ArgumentLoader.Factory of(@MaybeNull Object value) {
if (value == null) {
return ForNullConstant.INSTANCE;
} else if (value instanceof Boolean) {
Expand Down
Expand Up @@ -23,6 +23,7 @@
import net.bytebuddy.implementation.bytecode.StackManipulation;
import net.bytebuddy.implementation.bytecode.TypeCreation;
import net.bytebuddy.implementation.bytecode.member.MethodInvocation;
import net.bytebuddy.utility.nullability.MaybeNull;
import org.objectweb.asm.MethodVisitor;

import java.io.*;
Expand Down Expand Up @@ -58,7 +59,7 @@ protected SerializedConstant(String serialization) {
* @param value The value to serialize.
* @return A stack manipulation to serialize the supplied value.
*/
public static StackManipulation of(Serializable value) {
public static StackManipulation of(@MaybeNull Serializable value) {
if (value == null) {
return NullConstant.INSTANCE;
}
Expand Down

0 comments on commit c73549d

Please sign in to comment.