mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-13 22:16:11 +00:00
Merge pull request #1231 from bulgakovalexander/bugfix/NoArgsConstructorForce
fix of the issue 1228
This commit is contained in:
commit
cce6f39389
4 files changed
+37
No files matched your search
@@ -48,6 +48,7 @@ import org.eclipse.jdt.internal.compiler.ast.AllocationExpression;
|
||||
import org.eclipse.jdt.internal.compiler.ast.Annotation;
|
||||
import org.eclipse.jdt.internal.compiler.ast.Argument;
|
||||
import org.eclipse.jdt.internal.compiler.ast.ArrayInitializer;
|
||||
import org.eclipse.jdt.internal.compiler.ast.ArrayTypeReference;
|
||||
import org.eclipse.jdt.internal.compiler.ast.Assignment;
|
||||
import org.eclipse.jdt.internal.compiler.ast.CharLiteral;
|
||||
import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;
|
||||
@@ -381,6 +382,8 @@ public class HandleConstructor {
|
||||
}
|
||||
|
||||
private static Expression getDefaultExpr(TypeReference type, int s, int e) {
|
||||
boolean array = type instanceof ArrayTypeReference;
|
||||
if (array) return new NullLiteral(s, e);
|
||||
char[] lastToken = type.getLastToken();
|
||||
if (Arrays.equals(TypeConstants.BOOLEAN, lastToken)) return new FalseLiteral(s, e);
|
||||
if (Arrays.equals(TypeConstants.CHAR, lastToken)) return new CharLiteral(new char[] {'\'', '\\', '0', '\''}, s, e);
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
public class NoArgsConstructorForce {
|
||||
private final int[] i;
|
||||
private final Object[] o;
|
||||
private final java.util.List<?>[] fullQualifiedList;
|
||||
|
||||
@java.lang.SuppressWarnings("all")
|
||||
@javax.annotation.Generated("lombok")
|
||||
public NoArgsConstructorForce() {
|
||||
this.i = null;
|
||||
this.o = null;
|
||||
this.fullQualifiedList = null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import lombok.NoArgsConstructor;
|
||||
public @NoArgsConstructor(force = true) class NoArgsConstructorForce {
|
||||
private final int[] i;
|
||||
private final Object[] o;
|
||||
private final java.util.List<?>[] fullQualifiedList;
|
||||
public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") NoArgsConstructorForce() {
|
||||
super();
|
||||
this.i = null;
|
||||
this.o = null;
|
||||
this.fullQualifiedList = null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@NoArgsConstructor(force = true)
|
||||
public class NoArgsConstructorForce {
|
||||
private final int[] i;
|
||||
private final Object[] o;
|
||||
private final java.util.List<?>[] fullQualifiedList;
|
||||
}
|
||||
Reference in new issue
Block a user