From e95680a76733c22ee5937a586ee50c703d5ba621 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Mon, 20 Jan 2020 15:25:08 +0100 Subject: [issue #2221] [issue #788] Lombok now adds nullity annotations. Which 'flavour' is defined in lombok.config; applied to toString, equals, canEqual, and plural-form of `@Singular`. --- src/core/lombok/javac/handlers/HandleToString.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/core/lombok/javac/handlers/HandleToString.java') diff --git a/src/core/lombok/javac/handlers/HandleToString.java b/src/core/lombok/javac/handlers/HandleToString.java index d0d36e06..0a950f7c 100644 --- a/src/core/lombok/javac/handlers/HandleToString.java +++ b/src/core/lombok/javac/handlers/HandleToString.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2019 The Project Lombok Authors. + * Copyright (C) 2009-2020 The Project Lombok Authors. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -253,8 +253,10 @@ public class HandleToString extends JavacAnnotationHandler { JCBlock body = maker.Block(0, List.of(returnStatement)); - return recursiveSetGeneratedBy(maker.MethodDef(mods, typeNode.toName("toString"), returnType, - List.nil(), List.nil(), List.nil(), body, null), source, typeNode.getContext()); + JCMethodDecl methodDef = maker.MethodDef(mods, typeNode.toName("toString"), returnType, + List.nil(), List.nil(), List.nil(), body, null); + createRelevantNonNullAnnotation(typeNode, methodDef); + return recursiveSetGeneratedBy(methodDef, source, typeNode.getContext()); } public static String getTypeName(JavacNode typeNode) { -- cgit