From 1cdcfc204ef353180692a4162c13a9be34552913 Mon Sep 17 00:00:00 2001
From: Robbert Jan Grootjans <grootjans@gmail.com>
Date: Mon, 18 Jun 2012 19:47:07 +0200
Subject: Fixed NPE Caused by an empty set of getter/setter names being
 returned in the EclipseUtils.

---
 src/core/lombok/core/TransformationsUtil.java | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

(limited to 'src')

diff --git a/src/core/lombok/core/TransformationsUtil.java b/src/core/lombok/core/TransformationsUtil.java
index 7426ae18..69b6b734 100644
--- a/src/core/lombok/core/TransformationsUtil.java
+++ b/src/core/lombok/core/TransformationsUtil.java
@@ -168,7 +168,10 @@ public class TransformationsUtil {
 	 * @param isBoolean if the field is of type 'boolean'. For fields of type 'java.lang.Boolean', you should provide {@code false}.
 	 */
 	public static List<String> toAllGetterNames(AnnotationValues<Accessors> accessors, CharSequence fieldName, boolean isBoolean) {
-		if (!isBoolean) return Collections.singletonList(toGetterName(accessors, fieldName, false));
+		if (!isBoolean) {
+			String getterName = toGetterName(accessors, fieldName, false);
+			return (getterName == null) ? Collections.<String>emptyList() : Collections.singletonList(getterName);
+		}
 		
 		Accessors acc = accessors.getInstance();
 		fieldName = removePrefix(fieldName, acc.prefix());
@@ -199,7 +202,10 @@ public class TransformationsUtil {
 	 * @param isBoolean if the field is of type 'boolean'. For fields of type 'java.lang.Boolean', you should provide {@code false}.
 	 */
 	public static List<String> toAllSetterNames(AnnotationValues<Accessors> accessors, CharSequence fieldName, boolean isBoolean) {
-		if (!isBoolean) return Collections.singletonList(toSetterName(accessors, fieldName, false));
+		if (!isBoolean) {
+			String setterName = toSetterName(accessors, fieldName, false);
+			return (setterName == null) ? Collections.<String>emptyList() : Collections.singletonList(setterName);
+		}
 		
 		Accessors acc = accessors.getInstance();
 		fieldName = removePrefix(fieldName, acc.prefix());
-- 
cgit