diff options
author | Roel Spilker <r.spilker@gmail.com> | 2016-12-05 22:23:39 +0100 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2016-12-05 22:23:39 +0100 |
commit | 0727c8bfd305408074d908dc4f8c31c0bff54789 (patch) | |
tree | ae7308e54bfb75eb22c1cc9c1d9beebea0005b29 /src/core/lombok/eclipse/handlers/HandleFieldDefaults.java | |
parent | 7969951125db42a84fbdd46d4a5fb804842e00f9 (diff) | |
download | lombok-0727c8bfd305408074d908dc4f8c31c0bff54789.tar.gz lombok-0727c8bfd305408074d908dc4f8c31c0bff54789.tar.bz2 lombok-0727c8bfd305408074d908dc4f8c31c0bff54789.zip |
Fixes #1254: Value and FieldDefaults should skip static fields
Diffstat (limited to 'src/core/lombok/eclipse/handlers/HandleFieldDefaults.java')
-rw-r--r-- | src/core/lombok/eclipse/handlers/HandleFieldDefaults.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleFieldDefaults.java b/src/core/lombok/eclipse/handlers/HandleFieldDefaults.java index 5ea5a210..702713fe 100644 --- a/src/core/lombok/eclipse/handlers/HandleFieldDefaults.java +++ b/src/core/lombok/eclipse/handlers/HandleFieldDefaults.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2014 The Project Lombok Authors. + * Copyright (C) 2012-2016 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 @@ -97,14 +97,16 @@ public class HandleFieldDefaults extends EclipseASTAdapter { if (level != null && level != AccessLevel.NONE) { if ((field.modifiers & (ClassFileConstants.AccPublic | ClassFileConstants.AccPrivate | ClassFileConstants.AccProtected)) == 0) { if (!hasAnnotation(PackagePrivate.class, fieldNode)) { - field.modifiers |= EclipseHandlerUtil.toEclipseModifier(level); + if ((field.modifiers & ClassFileConstants.AccStatic) == 0) { + field.modifiers |= EclipseHandlerUtil.toEclipseModifier(level); + } } } } if (makeFinal && (field.modifiers & ClassFileConstants.AccFinal) == 0) { if (!hasAnnotation(NonFinal.class, fieldNode)) { - if ((field.modifiers & ClassFileConstants.AccStatic) == 0 || field.initialization != null) { + if ((field.modifiers & ClassFileConstants.AccStatic) == 0) { field.modifiers |= ClassFileConstants.AccFinal; } } |