mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-15 16:14:46 +00:00
Make extraPrivate opt-in instead of opt-out. Fixes #1708
This commit is contained in:
1 parent
b8e85f5dc7
commit
a74db7c10c
23 files changed
+5
-130
No files matched your search
@@ -3,6 +3,7 @@ Lombok Changelog
|
||||
|
||||
### v1.16.23 "Edgy Guinea Pig"
|
||||
* v1.16.22 is the latest stable release of Project Lombok.
|
||||
* BREAKING CHANGE: The in 1.16.22 introduced configuration key `lombok.noArgsConstructor.extraPrivate` is now `false` by default. [Issue #1708](https://github.com/rzwitserloot/lombok/issues/1708)
|
||||
* BUGFIX: Do not generate a private no-args constructor if that breaks the code. [Issue #1703](https://github.com/rzwitserloot/lombok/issues/1703), [Issue #1704](https://github.com/rzwitserloot/lombok/issues/1704), [Issue #1712](https://github.com/rzwitserloot/lombok/issues/1712)
|
||||
* BUGFIX: Using boolean parameters in lombok annotations would fail. [Issue #1709](https://github.com/rzwitserloot/lombok/issues/1709)
|
||||
* BUGFIX: Delombok would give an error message. [Issue #1705](https://github.com/rzwitserloot/lombok/issues/1705)
|
||||
|
||||
@@ -214,7 +214,7 @@ public class HandleConstructor {
|
||||
if (!isDirectDescendantOfObject(typeNode)) return;
|
||||
|
||||
Boolean v = typeNode.getAst().readConfiguration(ConfigurationKeys.NO_ARGS_CONSTRUCTOR_EXTRA_PRIVATE);
|
||||
if (v != null && !v) return;
|
||||
if (v == null || !v) return;
|
||||
|
||||
List<EclipseNode> fields = findFinalFields(typeNode);
|
||||
generate(typeNode, AccessLevel.PRIVATE, fields, true, null, SkipIfConstructorExists.NO, Collections.<Annotation>emptyList(), sourceNode, true);
|
||||
|
||||
@@ -200,7 +200,7 @@ public class HandleConstructor {
|
||||
if (!isDirectDescendantOfObject(typeNode)) return;
|
||||
|
||||
Boolean v = typeNode.getAst().readConfiguration(ConfigurationKeys.NO_ARGS_CONSTRUCTOR_EXTRA_PRIVATE);
|
||||
if (v != null && !v) return;
|
||||
if (v == null || !v) return;
|
||||
|
||||
List<JavacNode> fields = findFinalFields(typeNode);
|
||||
generate(typeNode, AccessLevel.PRIVATE, List.<JCAnnotation>nil(), fields, true, null, SkipIfConstructorExists.NO, source, true);
|
||||
|
||||
@@ -67,12 +67,6 @@ public final class BuilderDefaults {
|
||||
return new BuilderDefaultsBuilder();
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private BuilderDefaults() {
|
||||
this.x = 0;
|
||||
this.name = null;
|
||||
this.z = 0L;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
public int getX() {
|
||||
return this.x;
|
||||
}
|
||||
|
||||
@@ -44,11 +44,6 @@ public class BuilderWithRecursiveGenerics {
|
||||
return new TestBuilder<Foo, Bar, Quz>();
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private Test() {
|
||||
this.foo = null;
|
||||
this.bar = null;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
public Foo getFoo() {
|
||||
return this.foo;
|
||||
}
|
||||
|
||||
@@ -6,10 +6,6 @@ class DataIgnore {
|
||||
this.x = x;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private DataIgnore() {
|
||||
this.x = 0;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
public int getX() {
|
||||
return this.x;
|
||||
}
|
||||
|
||||
@@ -8,10 +8,6 @@ class DataOnLocalClass1 {
|
||||
this.x = x;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private Local() {
|
||||
this.x = 0;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
public int getX() {
|
||||
return this.x;
|
||||
}
|
||||
@@ -72,9 +68,6 @@ class DataOnLocalClass2 {
|
||||
}
|
||||
this.name = name;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private InnerLocal() {
|
||||
}
|
||||
@lombok.NonNull
|
||||
@java.lang.SuppressWarnings("all")
|
||||
public String getName() {
|
||||
@@ -123,10 +116,6 @@ class DataOnLocalClass2 {
|
||||
this.x = x;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private Local() {
|
||||
this.x = 0;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
public int getX() {
|
||||
return this.x;
|
||||
}
|
||||
|
||||
@@ -6,10 +6,6 @@ class Data1 {
|
||||
this.x = x;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private Data1() {
|
||||
this.x = 0;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
public int getX() {
|
||||
return this.x;
|
||||
}
|
||||
@@ -62,10 +58,6 @@ class Data2 {
|
||||
this.x = x;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private Data2() {
|
||||
this.x = 0;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
public int getX() {
|
||||
return this.x;
|
||||
}
|
||||
@@ -118,10 +110,6 @@ final class Data3 {
|
||||
this.x = x;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private Data3() {
|
||||
this.x = 0;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
public int getX() {
|
||||
return this.x;
|
||||
}
|
||||
|
||||
@@ -7,10 +7,6 @@ class DataWithGetter {
|
||||
this.z = z;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private DataWithGetter() {
|
||||
this.z = null;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
public void setX(final int x) {
|
||||
this.x = x;
|
||||
}
|
||||
|
||||
@@ -7,10 +7,6 @@ class DataWithGetterNone {
|
||||
this.z = z;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private DataWithGetterNone() {
|
||||
this.z = null;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
public void setX(final int x) {
|
||||
this.x = x;
|
||||
}
|
||||
|
||||
@@ -20,10 +20,6 @@ class C {
|
||||
this.a = a;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private D() {
|
||||
this.a = null;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
public A getA() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@@ -7,11 +7,6 @@ final class Value1 {
|
||||
this.name = name;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private Value1() {
|
||||
this.x = 0;
|
||||
this.name = null;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
public int getX() {
|
||||
return this.x;
|
||||
}
|
||||
@@ -56,11 +51,6 @@ class Value2 {
|
||||
this.name = name;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private Value2() {
|
||||
this.x = 0;
|
||||
this.name = null;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
public int getX() {
|
||||
return this.x;
|
||||
}
|
||||
@@ -110,10 +100,6 @@ final class Value3 {
|
||||
this.y = y;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private Value3() {
|
||||
this.y = 0;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
public int getX() {
|
||||
return this.x;
|
||||
}
|
||||
|
||||
@@ -87,10 +87,4 @@ public final @Value @Builder class BuilderDefaults {
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
|
||||
return (((((("BuilderDefaults(x=" + this.getX()) + ", name=") + this.getName()) + ", z=") + this.getZ()) + ")");
|
||||
}
|
||||
private @java.lang.SuppressWarnings("all") BuilderDefaults() {
|
||||
super();
|
||||
this.x = 0;
|
||||
this.name = null;
|
||||
this.z = 0L;
|
||||
}
|
||||
}
|
||||
@@ -70,11 +70,6 @@ public class BuilderWithRecursiveGenerics {
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
|
||||
return (((("BuilderWithRecursiveGenerics.Test(foo=" + this.getFoo()) + ", bar=") + this.getBar()) + ")");
|
||||
}
|
||||
private @java.lang.SuppressWarnings("all") Test() {
|
||||
super();
|
||||
this.foo = null;
|
||||
this.bar = null;
|
||||
}
|
||||
}
|
||||
public BuilderWithRecursiveGenerics() {
|
||||
super();
|
||||
|
||||
@@ -32,8 +32,4 @@
|
||||
super();
|
||||
this.x = x;
|
||||
}
|
||||
private @java.lang.SuppressWarnings("all") DataIgnore() {
|
||||
super();
|
||||
this.x = 0;
|
||||
}
|
||||
}
|
||||
@@ -50,10 +50,6 @@ class DataOnLocalClass1 {
|
||||
super();
|
||||
this.x = x;
|
||||
}
|
||||
private @java.lang.SuppressWarnings("all") Local() {
|
||||
super();
|
||||
this.x = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -107,9 +103,6 @@ class DataOnLocalClass2 {
|
||||
}
|
||||
this.name = name;
|
||||
}
|
||||
private @java.lang.SuppressWarnings("all") InnerLocal() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
final int x;
|
||||
public @java.lang.SuppressWarnings("all") int getX() {
|
||||
@@ -143,10 +136,6 @@ class DataOnLocalClass2 {
|
||||
super();
|
||||
this.x = x;
|
||||
}
|
||||
private @java.lang.SuppressWarnings("all") Local() {
|
||||
super();
|
||||
this.x = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
DataOnLocalClass2() {
|
||||
|
||||
@@ -45,10 +45,6 @@ import lombok.Data;
|
||||
super();
|
||||
this.x = x;
|
||||
}
|
||||
private @java.lang.SuppressWarnings("all") Data1() {
|
||||
super();
|
||||
this.x = 0;
|
||||
}
|
||||
}
|
||||
@Data class Data2 {
|
||||
final int x;
|
||||
@@ -96,10 +92,6 @@ import lombok.Data;
|
||||
super();
|
||||
this.x = x;
|
||||
}
|
||||
private @java.lang.SuppressWarnings("all") Data2() {
|
||||
super();
|
||||
this.x = 0;
|
||||
}
|
||||
}
|
||||
final @Data class Data3 {
|
||||
final int x;
|
||||
@@ -142,10 +134,6 @@ final @Data class Data3 {
|
||||
super();
|
||||
this.x = x;
|
||||
}
|
||||
private @java.lang.SuppressWarnings("all") Data3() {
|
||||
super();
|
||||
this.x = 0;
|
||||
}
|
||||
}
|
||||
final @Data @lombok.EqualsAndHashCode(callSuper = true) class Data4 extends java.util.Timer {
|
||||
int x;
|
||||
|
||||
@@ -45,10 +45,6 @@
|
||||
super();
|
||||
this.z = z;
|
||||
}
|
||||
private @java.lang.SuppressWarnings("all") DataWithGetter() {
|
||||
super();
|
||||
this.z = null;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") int getX() {
|
||||
return this.x;
|
||||
}
|
||||
|
||||
@@ -45,8 +45,4 @@
|
||||
super();
|
||||
this.z = z;
|
||||
}
|
||||
private @java.lang.SuppressWarnings("all") DataWithGetterNone() {
|
||||
super();
|
||||
this.z = null;
|
||||
}
|
||||
}
|
||||
@@ -49,10 +49,6 @@ class C {
|
||||
super();
|
||||
this.a = a;
|
||||
}
|
||||
private @java.lang.SuppressWarnings("all") D() {
|
||||
super();
|
||||
this.a = null;
|
||||
}
|
||||
}
|
||||
C() {
|
||||
super();
|
||||
|
||||
@@ -38,11 +38,6 @@ final @lombok.Value class Value1 {
|
||||
this.x = x;
|
||||
this.name = name;
|
||||
}
|
||||
private @java.lang.SuppressWarnings("all") Value1() {
|
||||
super();
|
||||
this.x = 0;
|
||||
this.name = null;
|
||||
}
|
||||
}
|
||||
@Value @lombok.experimental.NonFinal class Value2 {
|
||||
public final int x;
|
||||
@@ -88,11 +83,6 @@ final @lombok.Value class Value1 {
|
||||
this.x = x;
|
||||
this.name = name;
|
||||
}
|
||||
private @java.lang.SuppressWarnings("all") Value2() {
|
||||
super();
|
||||
this.x = 0;
|
||||
this.name = null;
|
||||
}
|
||||
}
|
||||
final @Value class Value3 {
|
||||
private @lombok.experimental.NonFinal int x;
|
||||
@@ -130,8 +120,4 @@ final @Value class Value3 {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
private @java.lang.SuppressWarnings("all") Value3() {
|
||||
super();
|
||||
this.y = 0;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
//CONF: lombok.anyConstructor.suppressConstructorProperties = true
|
||||
//CONF: lombok.toString.doNotUseGetters = true
|
||||
//CONF: lombok.equalsAndHashCode.doNotUseGetters = true
|
||||
//CONF: lombok.noArgsConstructor.extraPrivate = true
|
||||
@lombok.Data
|
||||
class DataConfiguration {
|
||||
final int x;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// CONF: lombok.noArgsConstructor.extraPrivate = true
|
||||
// CONF: lombok.equalsAndHashCode.callSuper = call
|
||||
public class PrivateNoArgsConstructor {
|
||||
private static class Base {
|
||||
|
||||
Reference in new issue
Block a user