aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/javac
diff options
context:
space:
mode:
authorRoel Spilker <r.spilker@gmail.com>2016-12-05 22:23:39 +0100
committerRoel Spilker <r.spilker@gmail.com>2016-12-05 22:23:39 +0100
commit0727c8bfd305408074d908dc4f8c31c0bff54789 (patch)
treeae7308e54bfb75eb22c1cc9c1d9beebea0005b29 /src/core/lombok/javac
parent7969951125db42a84fbdd46d4a5fb804842e00f9 (diff)
downloadlombok-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/javac')
-rw-r--r--src/core/lombok/javac/handlers/HandleFieldDefaults.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/lombok/javac/handlers/HandleFieldDefaults.java b/src/core/lombok/javac/handlers/HandleFieldDefaults.java
index 12c22059..52f6c39c 100644
--- a/src/core/lombok/javac/handlers/HandleFieldDefaults.java
+++ b/src/core/lombok/javac/handlers/HandleFieldDefaults.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012-2015 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
@@ -84,14 +84,16 @@ public class HandleFieldDefaults extends JavacASTAdapter {
if (level != null && level != AccessLevel.NONE) {
if ((field.mods.flags & (Flags.PUBLIC | Flags.PRIVATE | Flags.PROTECTED)) == 0) {
if (!hasAnnotationAndDeleteIfNeccessary(PackagePrivate.class, fieldNode)) {
- field.mods.flags |= toJavacModifier(level);
+ if ((field.mods.flags & Flags.STATIC) == 0) {
+ field.mods.flags |= toJavacModifier(level);
+ }
}
}
}
if (makeFinal && (field.mods.flags & Flags.FINAL) == 0) {
if (!hasAnnotationAndDeleteIfNeccessary(NonFinal.class, fieldNode)) {
- if ((field.mods.flags & Flags.STATIC) == 0 || field.init != null) {
+ if ((field.mods.flags & Flags.STATIC) == 0) {
field.mods.flags |= Flags.FINAL;
}
}