Merge branch 'master' into wither

Conflicts:
	src/core/lombok/javac/handlers/JavacHandlerUtil.java
This commit is contained in:
Reinier Zwitserloot committed 2012-08-06 20:37:21 +02:00
commit 87f763a94c
85 files changed
+729 -382

No files matched your search

+2
View File
@@ -5,6 +5,8 @@ Lombok Changelog
* BUGFIX: Eclipse would throw an OOME if using `@ExtensionMethod`. [Issue #390](http://code.google.com/p/projectlombok/issues/detail?id=390)
* BUGFIX: {Netbeans} `@Cleanup` and `@Synchronized` cause far fewer issues in the netbeans editor. [Issue #393](http://code.google.com/p/projectlombok/issues/detail?id=393)
* BUGFIX: {Installer} Erroneous messages about the installer complaining about needing root access when installing or removing lombok from eclipse installs has been fixed. The installer edge of this problem was actually already fixed in v0.11.2. [Issue #363](http://code.google.com/p/projectlombok/issues/detail?id=363)
* BUGFIX: `@ExtensionMethod` had all sorts of issues in javac. [Issue #399](http://code.google.com/p/projectlombok/issues/detail?id=399)
* BUGFIX: Generating static constructors with javac when you have fields with generics, i.e. `Class<T>`, caused errors. [Issue #396](http://code.google.com/p/projectlombok/issues/detail?id=396)
### v0.11.2 "Dashing Kakapo" (July 3rd, 2012)
* FEATURE: {Experimental} `@ExtensionMethod` is now available to add extensions to
@@ -798,18 +798,19 @@ public class EclipseHandlerUtil {
}
}
private static final Map<FieldDeclaration, GetterMethod> generatedLazyGetters = new WeakHashMap<FieldDeclaration, GetterMethod>();
private static final Map<FieldDeclaration, Object> generatedLazyGettersWithPrimitiveBoolean = new WeakHashMap<FieldDeclaration, Object>();
private static final Object MARKER = new Object();
static void registerCreatedLazyGetter(FieldDeclaration field, char[] methodName, TypeReference returnType) {
generatedLazyGetters.put(field, new GetterMethod(methodName, returnType));
if (!nameEquals(returnType.getTypeName(), "boolean") || returnType.dimensions() > 0) return;
generatedLazyGettersWithPrimitiveBoolean.put(field, MARKER);
}
private static GetterMethod findGetter(EclipseNode field) {
FieldDeclaration fieldDeclaration = (FieldDeclaration) field.get();
GetterMethod gm = generatedLazyGetters.get(fieldDeclaration);
if (gm != null) return gm;
boolean forceBool = generatedLazyGettersWithPrimitiveBoolean.containsKey(fieldDeclaration);
TypeReference fieldType = fieldDeclaration.type;
boolean isBoolean = nameEquals(fieldType.getTypeName(), "boolean") && fieldType.dimensions() == 0;
boolean isBoolean = forceBool || (nameEquals(fieldType.getTypeName(), "boolean") && fieldType.dimensions() == 0);
EclipseNode typeNode = field.up();
for (String potentialGetterName : toAllGetterNames(field, isBoolean)) {
@@ -156,20 +156,29 @@ public class HandleConstructor {
}
public void generateConstructor(EclipseNode typeNode, AccessLevel level, List<EclipseNode> fields, String staticName, boolean skipIfConstructorExists, boolean suppressConstructorProperties, ASTNode source) {
boolean staticConstrRequired = staticName != null && !staticName.equals("");
if (skipIfConstructorExists && constructorExists(typeNode) != MemberExistsResult.NOT_EXISTS) return;
if (skipIfConstructorExists) {
for (EclipseNode child : typeNode.down()) {
if (child.getKind() == Kind.ANNOTATION) {
if (annotationTypeMatches(NoArgsConstructor.class, child) ||
annotationTypeMatches(AllArgsConstructor.class, child) ||
annotationTypeMatches(RequiredArgsConstructor.class, child))
annotationTypeMatches(RequiredArgsConstructor.class, child)) {
if (staticConstrRequired) {
// @Data has asked us to generate a constructor, but we're going to skip this instruction, as an explicit 'make a constructor' annotation
// will take care of it. However, @Data also wants a specific static name; this will be ignored; the appropriate way to do this is to use
// the 'staticName' parameter of the @XArgsConstructor you've stuck on your type.
// We should warn that we're ignoring @Data's 'staticConstructor' param.
typeNode.addWarning("Ignoring static constructor name: explicit @XxxArgsConstructor annotation present; its `staticName` parameter will be used.", source.sourceStart, source.sourceEnd);
}
return;
}
}
}
}
boolean staticConstrRequired = staticName != null && !staticName.equals("");
ConstructorDeclaration constr = createConstructor(staticConstrRequired ? AccessLevel.PRIVATE : level, typeNode, fields, suppressConstructorProperties, source);
injectMethod(typeNode, constr);
if (staticConstrRequired) {
@@ -456,12 +456,18 @@ public class JavacResolution {
if (upper == null || upper.toString().equals("java.lang.Object")) {
return maker.Wildcard(maker.TypeBoundKind(BoundKind.UNBOUND), null);
}
if (upper.getTypeArguments().contains(type)) {
return maker.Wildcard(maker.TypeBoundKind(BoundKind.UNBOUND), null);
}
return maker.Wildcard(maker.TypeBoundKind(BoundKind.EXTENDS), typeToJCTree(upper, ast, false, false));
} else {
return maker.Wildcard(maker.TypeBoundKind(BoundKind.SUPER), typeToJCTree(lower, ast, false, false));
}
}
if (upper != null) {
if (upper.getTypeArguments().contains(type)) {
return maker.Wildcard(maker.TypeBoundKind(BoundKind.UNBOUND), null);
}
return typeToJCTree(upper, ast, allowCompound, allowVoid);
}
@@ -43,12 +43,10 @@ import com.sun.tools.javac.tree.JCTree.JCBlock;
import com.sun.tools.javac.tree.JCTree.JCClassDecl;
import com.sun.tools.javac.tree.JCTree.JCExpression;
import com.sun.tools.javac.tree.JCTree.JCFieldAccess;
import com.sun.tools.javac.tree.JCTree.JCIdent;
import com.sun.tools.javac.tree.JCTree.JCMethodDecl;
import com.sun.tools.javac.tree.JCTree.JCModifiers;
import com.sun.tools.javac.tree.JCTree.JCReturn;
import com.sun.tools.javac.tree.JCTree.JCStatement;
import com.sun.tools.javac.tree.JCTree.JCTypeApply;
import com.sun.tools.javac.tree.JCTree.JCTypeParameter;
import com.sun.tools.javac.tree.JCTree.JCVariableDecl;
import com.sun.tools.javac.util.List;
@@ -154,20 +152,29 @@ public class HandleConstructor {
}
public void generateConstructor(JavacNode typeNode, AccessLevel level, List<JavacNode> fields, String staticName, boolean skipIfConstructorExists, boolean suppressConstructorProperties, JavacNode source) {
boolean staticConstrRequired = staticName != null && !staticName.equals("");
if (skipIfConstructorExists && constructorExists(typeNode) != MemberExistsResult.NOT_EXISTS) return;
if (skipIfConstructorExists) {
for (JavacNode child : typeNode.down()) {
if (child.getKind() == Kind.ANNOTATION) {
if (annotationTypeMatches(NoArgsConstructor.class, child) ||
annotationTypeMatches(AllArgsConstructor.class, child) ||
annotationTypeMatches(RequiredArgsConstructor.class, child))
annotationTypeMatches(RequiredArgsConstructor.class, child)) {
if (staticConstrRequired) {
// @Data has asked us to generate a constructor, but we're going to skip this instruction, as an explicit 'make a constructor' annotation
// will take care of it. However, @Data also wants a specific static name; this will be ignored; the appropriate way to do this is to use
// the 'staticName' parameter of the @XArgsConstructor you've stuck on your type.
// We should warn that we're ignoring @Data's 'staticConstructor' param.
source.addWarning("Ignoring static constructor name: explicit @XxxArgsConstructor annotation present; its `staticName` parameter will be used.");
}
return;
}
}
}
}
boolean staticConstrRequired = staticName != null && !staticName.equals("");
JCMethodDecl constr = createConstructor(staticConstrRequired ? AccessLevel.PRIVATE : level, typeNode, fields, suppressConstructorProperties, source.get());
injectMethod(typeNode, constr);
if (staticConstrRequired) {
@@ -259,16 +266,7 @@ public class HandleConstructor {
for (JavacNode fieldNode : fields) {
JCVariableDecl field = (JCVariableDecl) fieldNode.get();
JCExpression pType;
if (field.vartype instanceof JCIdent) pType = maker.Ident(((JCIdent)field.vartype).name);
else if (field.vartype instanceof JCTypeApply) {
JCTypeApply typeApply = (JCTypeApply) field.vartype;
ListBuffer<JCExpression> tArgs = ListBuffer.lb();
for (JCExpression arg : typeApply.arguments) tArgs.append(arg);
pType = maker.TypeApply(typeApply.clazz, tArgs.toList());
} else {
pType = field.vartype;
}
JCExpression pType = cloneType(maker, field.vartype, source);
List<JCAnnotation> nonNulls = findAnnotations(fieldNode, TransformationsUtil.NON_NULL_PATTERN);
List<JCAnnotation> nullables = findAnnotations(fieldNode, TransformationsUtil.NULLABLE_PATTERN);
JCVariableDecl param = maker.VarDef(maker.Modifiers(Flags.FINAL, nonNulls.appendList(nullables)), field.name, pType, null);
@@ -55,7 +55,6 @@ import com.sun.tools.javac.tree.JCTree.JCExpression;
import com.sun.tools.javac.tree.JCTree.JCFieldAccess;
import com.sun.tools.javac.tree.JCTree.JCIdent;
import com.sun.tools.javac.tree.JCTree.JCMethodInvocation;
import com.sun.tools.javac.tree.TreeMaker;
/**
* Handles the {@link ExtensionMethod} annotation for javac.
@@ -180,10 +179,7 @@ public class HandleExtensionMethod extends JavacAnnotationHandler<ExtensionMetho
Type firstArgType = types.erasure(extensionMethodType.asMethodType().argtypes.get(0));
if (!types.isAssignable(receiverType, firstArgType)) continue;
methodCall.args = methodCall.args.prepend(receiver);
TreeMaker maker = annotationNode.getTreeMaker();
JCIdent extensionClassIdent = maker.Ident(annotationNode.toName(extensionProvider.toString()));
methodCall.meth = maker.Select(extensionClassIdent, annotationNode.toName(methodName));
methodCall.meth = chainDotsString(annotationNode, extensionProvider.toString() + "." + methodName);
return;
}
}
@@ -78,16 +78,16 @@ public class HandleSynchronized extends JavacAnnotationHandler<Synchronized> {
lockName = isStatic ? STATIC_LOCK_NAME : INSTANCE_LOCK_NAME;
}
TreeMaker maker = methodNode.getTreeMaker();
TreeMaker maker = methodNode.getTreeMaker().at(ast.pos);
if (fieldExists(lockName, methodNode) == MemberExistsResult.NOT_EXISTS) {
if (!autoMake) {
annotationNode.addError("The field " + lockName + " does not exist.");
return;
}
JCExpression objectType = chainDots(methodNode, "java", "lang", "Object");
JCExpression objectType = chainDots(methodNode, ast.pos, "java", "lang", "Object");
//We use 'new Object[0];' because unlike 'new Object();', empty arrays *ARE* serializable!
JCNewArray newObjectArray = maker.NewArray(chainDots(methodNode, "java", "lang", "Object"),
JCNewArray newObjectArray = maker.NewArray(chainDots(methodNode, ast.pos, "java", "lang", "Object"),
List.<JCExpression>of(maker.Literal(Javac.getCtcInt(TypeTags.class, "INT"), 0)), null);
JCVariableDecl fieldDecl = recursiveSetGeneratedBy(maker.VarDef(
maker.Modifiers(Flags.PRIVATE | Flags.FINAL | (isStatic ? Flags.STATIC : 0)),
@@ -99,7 +99,7 @@ public class HandleSynchronized extends JavacAnnotationHandler<Synchronized> {
JCExpression lockNode;
if (isStatic) {
lockNode = chainDots(methodNode, methodNode.up().getName(), lockName);
lockNode = chainDots(methodNode, ast.pos, methodNode.up().getName(), lockName);
} else {
lockNode = maker.Select(maker.Ident(methodNode.toName("this")), methodNode.toName(lockName));
}
@@ -45,14 +45,17 @@ import lombok.experimental.Accessors;
import lombok.javac.Javac;
import lombok.javac.JavacNode;
import com.sun.tools.javac.code.BoundKind;
import com.sun.tools.javac.code.Flags;
import com.sun.tools.javac.code.TypeTags;
import com.sun.tools.javac.tree.JCTree;
import com.sun.tools.javac.tree.JCTree.JCAnnotation;
import com.sun.tools.javac.tree.JCTree.JCArrayTypeTree;
import com.sun.tools.javac.tree.JCTree.JCAssign;
import com.sun.tools.javac.tree.JCTree.JCClassDecl;
import com.sun.tools.javac.tree.JCTree.JCCompilationUnit;
import com.sun.tools.javac.tree.JCTree.JCExpression;
import com.sun.tools.javac.tree.JCTree.JCFieldAccess;
import com.sun.tools.javac.tree.JCTree.JCIdent;
import com.sun.tools.javac.tree.JCTree.JCImport;
import com.sun.tools.javac.tree.JCTree.JCLiteral;
@@ -60,9 +63,13 @@ import com.sun.tools.javac.tree.JCTree.JCMethodDecl;
import com.sun.tools.javac.tree.JCTree.JCMethodInvocation;
import com.sun.tools.javac.tree.JCTree.JCModifiers;
import com.sun.tools.javac.tree.JCTree.JCNewArray;
import com.sun.tools.javac.tree.JCTree.JCPrimitiveTypeTree;
import com.sun.tools.javac.tree.JCTree.JCStatement;
import com.sun.tools.javac.tree.JCTree.JCTypeParameter;
import com.sun.tools.javac.tree.JCTree.JCTypeApply;
import com.sun.tools.javac.tree.JCTree.JCVariableDecl;
import com.sun.tools.javac.tree.JCTree.JCWildcard;
import com.sun.tools.javac.tree.JCTree.TypeBoundKind;
import com.sun.tools.javac.tree.TreeMaker;
import com.sun.tools.javac.tree.TreeScanner;
import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
@@ -244,6 +251,7 @@ public class JavacHandlerUtil {
* Only does this if the DeleteLombokAnnotations class is in the context.
*/
public static void deleteAnnotationIfNeccessary(JavacNode annotation, Class<? extends Annotation> annotationType) {
if (inNetbeansEditor(annotation)) return;
if (!annotation.shouldDeleteLombokAnnotations()) return;
JavacNode parentNode = annotation.directUp();
switch (parentNode.getKind()) {
@@ -274,6 +282,7 @@ public class JavacHandlerUtil {
}
public static void deleteImportFromCompilationUnit(JavacNode node, String name) {
if (inNetbeansEditor(node)) return;
if (!node.shouldDeleteLombokAnnotations()) return;
ListBuffer<JCTree> newDefs = ListBuffer.lb();
@@ -768,6 +777,8 @@ public class JavacHandlerUtil {
* In javac, dotted access of any kind, from {@code java.lang.String} to {@code var.methodName}
* is represented by a fold-left of {@code Select} nodes with the leftmost string represented by
* a {@code Ident} node. This method generates such an expression.
* <p>
* The position of the generated node(s) will be unpositioned (-1).
*
* For example, maker.Select(maker.Select(maker.Ident(NAME[java]), NAME[lang]), NAME[String]).
*
@@ -775,12 +786,30 @@ public class JavacHandlerUtil {
* @see com.sun.tools.javac.tree.JCTree.JCFieldAccess
*/
public static JCExpression chainDots(JavacNode node, String... elems) {
return chainDots(node, -1, elems);
}
/**
* In javac, dotted access of any kind, from {@code java.lang.String} to {@code var.methodName}
* is represented by a fold-left of {@code Select} nodes with the leftmost string represented by
* a {@code Ident} node. This method generates such an expression.
* <p>
* The position of the generated node(s) will be equal to the {@code pos} parameter.
*
* For example, maker.Select(maker.Select(maker.Ident(NAME[java]), NAME[lang]), NAME[String]).
*
* @see com.sun.tools.javac.tree.JCTree.JCIdent
* @see com.sun.tools.javac.tree.JCTree.JCFieldAccess
*/
public static JCExpression chainDots(JavacNode node, int pos, String... elems) {
assert elems != null;
assert elems.length > 0;
JCExpression e = node.getTreeMaker().Ident(node.toName(elems[0]));
TreeMaker maker = node.getTreeMaker();
if (pos != -1) maker = maker.at(pos);
JCExpression e = maker.Ident(node.toName(elems[0]));
for (int i = 1 ; i < elems.length ; i++) {
e = node.getTreeMaker().Select(e, node.toName(elems[i]));
e = maker.Select(e, node.toName(elems[i]));
}
return e;
@@ -798,7 +827,7 @@ public class JavacHandlerUtil {
* @see com.sun.tools.javac.tree.JCTree.JCFieldAccess
*/
public static JCExpression chainDotsString(JavacNode node, String elems) {
return chainDots(node, elems.split("\\."));
return chainDots(node, elems.split("\\."));
}
/**
@@ -922,4 +951,71 @@ public class JavacHandlerUtil {
return node;
}
/**
* Creates a full clone of a given javac AST type node. Every part is cloned (every identifier, every select, every wildcard, every type apply).
*
* If there's any node in the tree that we don't know how to clone, that part isn't cloned. However, we wouldn't know what could possibly show up that we
* can't currently clone; that's just a safeguard.
*
* This should be used if the type looks the same in the code, but resolves differently. For example, a static method that has some generics in it named after
* the class's own parameter, but as its a static method, the static method's notion of {@code T} is different from the class notion of {@code T}. If you're duplicating
* a type used in the class context, you need to use this method.
*/
public static JCExpression cloneType(TreeMaker maker, JCExpression in, JCTree source) {
JCExpression out = cloneType0(maker, in);
if (out != null) recursiveSetGeneratedBy(out, source);
return out;
}
private static JCExpression cloneType0(TreeMaker maker, JCTree in) {
if (in == null) return null;
if (in instanceof JCPrimitiveTypeTree) return (JCExpression) in;
if (in instanceof JCIdent) {
return maker.Ident(((JCIdent) in).name);
}
if (in instanceof JCFieldAccess) {
JCFieldAccess fa = (JCFieldAccess) in;
return maker.Select(cloneType0(maker, fa.selected), fa.name);
}
if (in instanceof JCArrayTypeTree) {
JCArrayTypeTree att = (JCArrayTypeTree) in;
return maker.TypeArray(cloneType0(maker, att.elemtype));
}
if (in instanceof JCTypeApply) {
JCTypeApply ta = (JCTypeApply) in;
ListBuffer<JCExpression> lb = ListBuffer.lb();
for (JCExpression typeArg : ta.arguments) {
lb.append(cloneType0(maker, typeArg));
}
return maker.TypeApply(cloneType0(maker, ta.clazz), lb.toList());
}
if (in instanceof JCWildcard) {
JCWildcard w = (JCWildcard) in;
JCExpression newInner = cloneType0(maker, w.inner);
TypeBoundKind newKind;
switch (w.getKind()) {
case SUPER_WILDCARD:
newKind = maker.TypeBoundKind(BoundKind.SUPER);
break;
case EXTENDS_WILDCARD:
newKind = maker.TypeBoundKind(BoundKind.EXTENDS);
break;
default:
case UNBOUNDED_WILDCARD:
newKind = maker.TypeBoundKind(BoundKind.UNBOUND);
break;
}
return maker.Wildcard(newKind, newInner);
}
// This is somewhat unsafe, but it's better than outright throwing an exception here. Returning null will just cause an exception down the pipeline.
return (JCExpression) in;
}
}
@@ -381,6 +381,7 @@ public class Delombok {
}
JavaCompiler delegate = compiler.processAnnotations(compiler.enterTrees(toJavacList(roots)));
delegate.flow(delegate.attribute(delegate.todo));
for (JCCompilationUnit unit : roots) {
DelombokResult result = new DelombokResult(catcher.getComments(unit), unit, force || options.isChanged(unit));
if (verbose) feedback.printf("File: %s [%s]\n", unit.sourcefile.getName(), result.isChanged() ? "delomboked" : "unchanged");
@@ -1037,8 +1037,17 @@ public class PrettyCommentsPrinter extends JCTree.Visitor {
throw new UncheckedIOException(e);
}
}
private boolean isNoArgsSuperCall(JCExpression expr) {
if (!(expr instanceof JCMethodInvocation)) return false;
JCMethodInvocation tree = (JCMethodInvocation) expr;
if (!tree.typeargs.isEmpty() || !tree.args.isEmpty()) return false;
if (!(tree.meth instanceof JCIdent)) return false;
return ((JCIdent) tree.meth).name.toString().equals("super");
}
public void visitExec(JCExpressionStatement tree) {
if (isNoArgsSuperCall(tree.expr)) return;
try {
printExpr(tree.expr);
if (prec == TreeInfo.notExpression) print(";");
@@ -26,6 +26,7 @@ import static org.junit.Assert.*;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.StringReader;
@@ -35,6 +36,11 @@ import java.util.List;
public abstract class AbstractRunTests {
protected static final String LINE_SEPARATOR = System.getProperty("line.separator");
private final File dumpActualFilesHere;
public AbstractRunTests() {
this.dumpActualFilesHere = findPlaceToDumpActualFiles();
}
public boolean compareFile(DirectoryRunner.TestParams params, File file) throws Throwable {
StringBuilder messages = new StringBuilder();
@@ -82,6 +88,25 @@ public abstract class AbstractRunTests {
return readFile(new File(dir, file.getName() + (messages ? ".messages" : "")));
}
private static File findPlaceToDumpActualFiles() {
String location = System.getProperty("lombok.tests.dump_actual_files");
if (location != null) {
File dumpActualFilesHere = new File(location);
dumpActualFilesHere.mkdirs();
return dumpActualFilesHere;
}
return null;
}
private static void dumpToFile(File file, String content) throws IOException {
FileOutputStream fos = new FileOutputStream(file);
try {
fos.write(content.getBytes("UTF-8"));
} finally {
fos.close();
}
}
private void compare(String name, String expectedFile, String actualFile, String expectedMessages, String actualMessages, boolean printErrors) throws Throwable {
try {
compareContent(name, expectedFile, actualFile);
@@ -99,6 +124,9 @@ public abstract class AbstractRunTests {
}
System.out.println("*******************");
}
if (dumpActualFilesHere != null) {
dumpToFile(new File(dumpActualFilesHere, name), actualFile);
}
throw e;
}
try {
@@ -113,6 +141,9 @@ public abstract class AbstractRunTests {
System.out.println(actualMessages);
System.out.println("*******************");
}
if (dumpActualFilesHere != null) {
dumpToFile(new File(dumpActualFilesHere, name + ".messages"), actualMessages);
}
throw e;
}
}
@@ -0,0 +1,29 @@
class ConflictingStaticConstructorNames {
@java.lang.Override
@java.lang.SuppressWarnings("all")
public boolean equals(final java.lang.Object o) {
if (o == this) return true;
if (!(o instanceof ConflictingStaticConstructorNames)) return false;
final ConflictingStaticConstructorNames other = (ConflictingStaticConstructorNames)o;
if (!other.canEqual((java.lang.Object)this)) return false;
return true;
}
@java.lang.SuppressWarnings("all")
public boolean canEqual(final java.lang.Object other) {
return other instanceof ConflictingStaticConstructorNames;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
public int hashCode() {
int result = 1;
return result;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
public java.lang.String toString() {
return "ConflictingStaticConstructorNames()";
}
@java.lang.SuppressWarnings("all")
public ConflictingStaticConstructorNames() {
}
}
@@ -58,4 +58,18 @@ class RequiredArgsConstructorStaticNameGenerics<T extends Number> {
public static <T extends Number> RequiredArgsConstructorStaticNameGenerics<T> of(final T x) {
return new RequiredArgsConstructorStaticNameGenerics<T>(x);
}
}
class RequiredArgsConstructorStaticNameGenerics2<T extends Number> {
final Class<T> x;
String name;
@java.lang.SuppressWarnings("all")
private RequiredArgsConstructorStaticNameGenerics2(final Class<T> x) {
this.x = x;
}
@java.lang.SuppressWarnings("all")
public static <T extends Number> RequiredArgsConstructorStaticNameGenerics2<T> of(final Class<T> x) {
return new RequiredArgsConstructorStaticNameGenerics2<T>(x);
}
}
@@ -155,7 +155,6 @@ final class Data3 {
final class Data4 extends java.util.Timer {
int x;
Data4() {
super();
}
@java.lang.SuppressWarnings("all")
public int getX() {
@@ -0,0 +1,17 @@
class ExtensionMethodPlain {
public String test() {
int[] intArray = {5, 3, 8, 2};
java.util.Arrays.sort(intArray);
String iAmNull = null;
return ExtensionMethodPlain.Extensions.or(iAmNull, ExtensionMethodPlain.Extensions.toTitleCase("hELlO, WORlD!"));
}
static class Extensions {
public static <T> T or(T obj, T ifNull) {
return obj != null ? obj : ifNull;
}
public static String toTitleCase(String in) {
if (in.isEmpty()) return in;
return "" + Character.toTitleCase(in.charAt(0)) + in.substring(1).toLowerCase();
}
}
}
@@ -1,6 +1,5 @@
class SneakyThrowsPlain {
SneakyThrowsPlain() {
super();
try {
System.out.println("constructor");
} catch (final java.lang.Throwable $ex) {
@@ -1,19 +1,12 @@
class SynchronizedName {
private Object read = new Object();
private static Object READ = new Object();
void test1() {
synchronized (this.read) {
System.out.println("one");
}
}
void test2() {
System.out.println("two");
}
static void test3() {
synchronized (SynchronizedName.read) {
System.out.println("three");
}
}
void test4() {
synchronized (this.READ) {
System.out.println("four");
@@ -24,4 +17,4 @@ class SynchronizedName {
System.out.println("five");
}
}
}
}
@@ -0,0 +1,7 @@
class SynchronizedNameNoSuchField {
private Object read = new Object();
private static Object READ = new Object();
void test2() {
System.out.println("two");
}
}
@@ -0,0 +1,9 @@
class SynchronizedNameStaticToInstanceRef {
private Object read = new Object();
private static Object READ = new Object();
static void test3() {
synchronized (SynchronizedNameStaticToInstanceRef.read) {
System.out.println("three");
}
}
}
@@ -1,5 +1,8 @@
class AccessorsFluent {
private @lombok.Getter @lombok.Setter @lombok.experimental.Accessors(fluent = true) String fieldName = "";
AccessorsFluent() {
super();
}
public @java.lang.SuppressWarnings("all") String fieldName() {
return this.fieldName;
}
@@ -7,13 +10,13 @@ class AccessorsFluent {
this.fieldName = fieldName;
return this;
}
AccessorsFluent() {
super();
}
}
@lombok.experimental.Accessors(fluent = true) @lombok.Getter class AccessorsFluentOnClass {
private @lombok.Setter String fieldName = "";
private @lombok.experimental.Accessors String otherFieldWithOverride = "";
AccessorsFluentOnClass() {
super();
}
public @java.lang.SuppressWarnings("all") AccessorsFluentOnClass fieldName(final String fieldName) {
this.fieldName = fieldName;
return this;
@@ -24,45 +27,48 @@ class AccessorsFluent {
public @java.lang.SuppressWarnings("all") String getOtherFieldWithOverride() {
return this.otherFieldWithOverride;
}
AccessorsFluentOnClass() {
super();
}
}
class AccessorsChain {
private @lombok.Setter @lombok.experimental.Accessors(chain = true) boolean isRunning;
AccessorsChain() {
super();
}
public @java.lang.SuppressWarnings("all") AccessorsChain setRunning(final boolean isRunning) {
this.isRunning = isRunning;
return this;
}
AccessorsChain() {
super();
}
}
@lombok.experimental.Accessors(prefix = "f") class AccessorsPrefix {
private @lombok.Setter String fieldName;
private @lombok.Setter String fActualField;
public @java.lang.SuppressWarnings("all") void setActualField(final String fActualField) {
this.fActualField = fActualField;
}
AccessorsPrefix() {
super();
}
public @java.lang.SuppressWarnings("all") void setActualField(final String fActualField) {
this.fActualField = fActualField;
}
}
@lombok.experimental.Accessors(prefix = {"f", ""}) class AccessorsPrefix2 {
private @lombok.Setter String fieldName;
private @lombok.Setter String fActualField;
AccessorsPrefix2() {
super();
}
public @java.lang.SuppressWarnings("all") void setFieldName(final String fieldName) {
this.fieldName = fieldName;
}
public @java.lang.SuppressWarnings("all") void setActualField(final String fActualField) {
this.fActualField = fActualField;
}
AccessorsPrefix2() {
super();
}
}
@lombok.experimental.Accessors(prefix = "f") @lombok.ToString @lombok.EqualsAndHashCode class AccessorsPrefix3 {
private String fName;
AccessorsPrefix3() {
super();
}
private String getName() {
return fName;
}
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return (("AccessorsPrefix3(fName=" + this.getName()) + ")");
}
@@ -90,40 +96,34 @@ class AccessorsChain {
result = ((result * PRIME) + (($fName == null) ? 0 : $fName.hashCode()));
return result;
}
AccessorsPrefix3() {
super();
}
private String getName() {
return fName;
}
}
class AccessorsFluentGenerics<T extends Number> {
private @lombok.Setter @lombok.experimental.Accessors(fluent = true) String name;
AccessorsFluentGenerics() {
super();
}
public @java.lang.SuppressWarnings("all") AccessorsFluentGenerics<T> name(final String name) {
this.name = name;
return this;
}
AccessorsFluentGenerics() {
super();
}
}
class AccessorsFluentNoChaining {
private @lombok.Setter @lombok.experimental.Accessors(fluent = true,chain = false) String name;
public @java.lang.SuppressWarnings("all") void name(final String name) {
this.name = name;
}
AccessorsFluentNoChaining() {
super();
}
public @java.lang.SuppressWarnings("all") void name(final String name) {
this.name = name;
}
}
class AccessorsFluentStatic<T extends Number> {
private static @lombok.Setter @lombok.experimental.Accessors(fluent = true) String name;
<clinit>() {
}
public static @java.lang.SuppressWarnings("all") void name(final String name) {
AccessorsFluentStatic.name = name;
}
AccessorsFluentStatic() {
super();
}
public static @java.lang.SuppressWarnings("all") void name(final String name) {
AccessorsFluentStatic.name = name;
}
}
@@ -1,9 +1,9 @@
class GetFoo {
private @lombok.Getter int foo;
public @java.lang.SuppressWarnings("all") int getFoo() {
return this.foo;
}
GetFoo() {
super();
}
public @java.lang.SuppressWarnings("all") int getFoo() {
return this.foo;
}
}
@@ -2,11 +2,11 @@ import lombok.Getter;
public class CommentsInterspersed {
private int x;
private @Getter String test = "foo";
public @java.lang.SuppressWarnings("all") String getTest() {
return this.test;
}
public CommentsInterspersed() {
super();
}
public native void gwtTest();
public @java.lang.SuppressWarnings("all") String getTest() {
return this.test;
}
}
@@ -0,0 +1,25 @@
@lombok.Data(staticConstructor = "of") @lombok.NoArgsConstructor class ConflictingStaticConstructorNames {
public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) {
if ((o == this))
return true;
if ((! (o instanceof ConflictingStaticConstructorNames)))
return false;
final @java.lang.SuppressWarnings("all") ConflictingStaticConstructorNames other = (ConflictingStaticConstructorNames) o;
if ((! other.canEqual((java.lang.Object) this)))
return false;
return true;
}
public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) {
return (other instanceof ConflictingStaticConstructorNames);
}
public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() {
int result = 1;
return result;
}
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return "ConflictingStaticConstructorNames()";
}
public @java.lang.SuppressWarnings("all") ConflictingStaticConstructorNames() {
super();
}
}
@@ -51,4 +51,15 @@
public static @java.lang.SuppressWarnings("all") <T extends Number>RequiredArgsConstructorStaticNameGenerics<T> of(final T x) {
return new RequiredArgsConstructorStaticNameGenerics<T>(x);
}
}
@lombok.RequiredArgsConstructor(staticName = "of") class RequiredArgsConstructorStaticNameGenerics2<T extends Number> {
final Class<T> x;
String name;
private @java.lang.SuppressWarnings("all") RequiredArgsConstructorStaticNameGenerics2(final Class<T> x) {
super();
this.x = x;
}
public static @java.lang.SuppressWarnings("all") <T extends Number>RequiredArgsConstructorStaticNameGenerics2<T> of(final Class<T> x) {
return new RequiredArgsConstructorStaticNameGenerics2<T>(x);
}
}
@@ -1,8 +1,5 @@
@lombok.Data @lombok.ToString(doNotUseGetters = true) class DataExtended {
int x;
public @java.lang.SuppressWarnings("all") DataExtended() {
super();
}
public @java.lang.SuppressWarnings("all") int getX() {
return this.x;
}
@@ -30,6 +27,9 @@
result = ((result * PRIME) + this.getX());
return result;
}
public @java.lang.SuppressWarnings("all") DataExtended() {
super();
}
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return (("DataExtended(x=" + this.x) + ")");
}
@@ -1,10 +1,6 @@
@lombok.Data class DataIgnore {
final int x;
String $name;
public @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") DataIgnore(final int x) {
super();
this.x = x;
}
public @java.lang.SuppressWarnings("all") int getX() {
return this.x;
}
@@ -32,4 +28,8 @@
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return (("DataIgnore(x=" + this.getX()) + ")");
}
public @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") DataIgnore(final int x) {
super();
this.x = x;
}
}
@@ -3,14 +3,14 @@ public @lombok.Getter @lombok.ToString @lombok.RequiredArgsConstructor enum Data
private final String someField;
<clinit>() {
}
private @java.lang.SuppressWarnings("all") DataOnEnum(final String someField) {
super();
this.someField = someField;
}
public @java.lang.SuppressWarnings("all") String getSomeField() {
return this.someField;
}
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return (("DataOnEnum(someField=" + this.getSomeField()) + ")");
}
}
private @java.lang.SuppressWarnings("all") DataOnEnum(final String someField) {
super();
this.someField = someField;
}
}
@@ -7,10 +7,6 @@ class DataOnLocalClass1 {
@Data class Local {
final int x;
String name;
public @java.lang.SuppressWarnings("all") Local(final int x) {
super();
this.x = x;
}
public @java.lang.SuppressWarnings("all") int getX() {
return this.x;
}
@@ -50,6 +46,10 @@ class DataOnLocalClass1 {
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return (((("Local(x=" + this.getX()) + ", name=") + this.getName()) + ")");
}
public @java.lang.SuppressWarnings("all") Local(final int x) {
super();
this.x = x;
}
}
}
}
@@ -58,12 +58,6 @@ class DataOnLocalClass2 {
@Data class Local {
@Data class InnerLocal {
@lombok.NonNull String name;
public @java.lang.SuppressWarnings("all") InnerLocal(final @lombok.NonNull String name) {
super();
if ((name == null))
throw new java.lang.NullPointerException("name");
this.name = name;
}
public @lombok.NonNull @java.lang.SuppressWarnings("all") String getName() {
return this.name;
}
@@ -99,12 +93,14 @@ class DataOnLocalClass2 {
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return (("Local.InnerLocal(name=" + this.getName()) + ")");
}
public @java.lang.SuppressWarnings("all") InnerLocal(final @lombok.NonNull String name) {
super();
if ((name == null))
throw new java.lang.NullPointerException("name");
this.name = name;
}
}
final int x;
public @java.lang.SuppressWarnings("all") Local(final int x) {
super();
this.x = x;
}
public @java.lang.SuppressWarnings("all") int getX() {
return this.x;
}
@@ -132,9 +128,13 @@ class DataOnLocalClass2 {
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return (("Local(x=" + this.getX()) + ")");
}
public @java.lang.SuppressWarnings("all") Local(final int x) {
super();
this.x = x;
}
}
}
DataOnLocalClass2() {
super();
}
}
}
@@ -2,10 +2,6 @@ import lombok.Data;
@lombok.Data class Data1 {
final int x;
String name;
public @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") Data1(final int x) {
super();
this.x = x;
}
public @java.lang.SuppressWarnings("all") int getX() {
return this.x;
}
@@ -45,14 +41,14 @@ import lombok.Data;
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return (((("Data1(x=" + this.getX()) + ", name=") + this.getName()) + ")");
}
public @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") Data1(final int x) {
super();
this.x = x;
}
}
@Data class Data2 {
final int x;
String name;
public @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") Data2(final int x) {
super();
this.x = x;
}
public @java.lang.SuppressWarnings("all") int getX() {
return this.x;
}
@@ -92,14 +88,14 @@ import lombok.Data;
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return (((("Data2(x=" + this.getX()) + ", name=") + this.getName()) + ")");
}
public @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") Data2(final int x) {
super();
this.x = x;
}
}
final @Data class Data3 {
final int x;
String name;
public @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") Data3(final int x) {
super();
this.x = x;
}
public @java.lang.SuppressWarnings("all") int getX() {
return this.x;
}
@@ -134,9 +130,16 @@ final @Data class Data3 {
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return (((("Data3(x=" + this.getX()) + ", name=") + this.getName()) + ")");
}
public @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") Data3(final int x) {
super();
this.x = x;
}
}
final @Data @lombok.EqualsAndHashCode(callSuper = true) class Data4 extends java.util.Timer {
int x;
Data4() {
super();
}
public @java.lang.SuppressWarnings("all") int getX() {
return this.x;
}
@@ -170,14 +173,8 @@ final @Data @lombok.EqualsAndHashCode(callSuper = true) class Data4 extends java
result = ((result * PRIME) + this.getX());
return result;
}
Data4() {
super();
}
}
@Data class Data5 {
public @java.lang.SuppressWarnings("all") Data5() {
super();
}
public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) {
if ((o == this))
return true;
@@ -198,11 +195,11 @@ final @Data @lombok.EqualsAndHashCode(callSuper = true) class Data4 extends java
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return "Data5()";
}
}
final @Data class Data6 {
public @java.lang.SuppressWarnings("all") Data6() {
public @java.lang.SuppressWarnings("all") Data5() {
super();
}
}
final @Data class Data6 {
public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) {
if ((o == this))
return true;
@@ -217,4 +214,7 @@ final @Data class Data6 {
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return "Data6()";
}
}
public @java.lang.SuppressWarnings("all") Data6() {
super();
}
}
@@ -2,10 +2,6 @@
private int x;
private int y;
private final String z;
public @java.beans.ConstructorProperties({"z"}) @java.lang.SuppressWarnings("all") DataWithGetter(final String z) {
super();
this.z = z;
}
public @java.lang.SuppressWarnings("all") void setX(final int x) {
this.x = x;
}
@@ -45,6 +41,10 @@
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return (((((("DataWithGetter(x=" + this.getX()) + ", y=") + this.getY()) + ", z=") + this.getZ()) + ")");
}
public @java.beans.ConstructorProperties({"z"}) @java.lang.SuppressWarnings("all") DataWithGetter(final String z) {
super();
this.z = z;
}
public @java.lang.SuppressWarnings("all") int getX() {
return this.x;
}
@@ -54,4 +54,4 @@
public @java.lang.SuppressWarnings("all") String getZ() {
return this.z;
}
}
}
@@ -2,10 +2,6 @@
private int x;
private int y;
private final String z;
public @java.beans.ConstructorProperties({"z"}) @java.lang.SuppressWarnings("all") DataWithGetterNone(final String z) {
super();
this.z = z;
}
public @java.lang.SuppressWarnings("all") void setX(final int x) {
this.x = x;
}
@@ -45,4 +41,8 @@
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return (((((("DataWithGetterNone(x=" + this.x) + ", y=") + this.y) + ", z=") + this.z) + ")");
}
}
public @java.beans.ConstructorProperties({"z"}) @java.lang.SuppressWarnings("all") DataWithGetterNone(final String z) {
super();
this.z = z;
}
}
@@ -6,6 +6,9 @@ class DelegateOnGetter {
int getInt();
}
private final @Delegate @Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<Bar>> bar = new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<Bar>>();
DelegateOnGetter() {
super();
}
public @Delegate @java.lang.SuppressWarnings("all") Bar getBar() {
java.util.concurrent.atomic.AtomicReference<Bar> value = this.bar.get();
if ((value == null))
@@ -38,7 +41,4 @@ class DelegateOnGetter {
public @java.lang.SuppressWarnings("all") void setList(final java.util.ArrayList<java.lang.String> list) {
this.getBar().setList(list);
}
DelegateOnGetter() {
super();
}
}
}
@@ -7,13 +7,13 @@ import lombok.Getter;
int getInt();
}
private final @Delegate @Getter(AccessLevel.NONE) Bar bar = null;
DelegateOnGetterNone() {
super();
}
public @java.lang.SuppressWarnings("all") int getInt() {
return this.bar.getInt();
}
public @java.lang.SuppressWarnings("all") void setList(final java.util.ArrayList<java.lang.String> list) {
this.bar.setList(list);
}
DelegateOnGetterNone() {
super();
}
}
}
@@ -3,11 +3,11 @@ abstract class DelegateOnMethods {
public static interface Bar {
void bar(java.util.ArrayList<java.lang.String> list);
}
public @java.lang.SuppressWarnings("all") void bar(final java.util.ArrayList<java.lang.String> list) {
this.getBar().bar(list);
}
DelegateOnMethods() {
super();
}
public abstract @Delegate Bar getBar();
}
public @java.lang.SuppressWarnings("all") void bar(final java.util.ArrayList<java.lang.String> list) {
this.getBar().bar(list);
}
}
@@ -1,21 +1,21 @@
import lombok.Delegate;
class DelegateRecursionOuterMost {
private final @Delegate DelegateRecursionCenter center = new DelegateRecursionCenter();
public @java.lang.SuppressWarnings("all") void innerMostMethod() {
this.center.innerMostMethod();
}
DelegateRecursionOuterMost() {
super();
}
public @java.lang.SuppressWarnings("all") void innerMostMethod() {
this.center.innerMostMethod();
}
}
class DelegateRecursionCenter {
private final @Delegate DelegateRecursionInnerMost inner = new DelegateRecursionInnerMost();
public @java.lang.SuppressWarnings("all") void innerMostMethod() {
this.inner.innerMostMethod();
}
DelegateRecursionCenter() {
super();
}
public @java.lang.SuppressWarnings("all") void innerMostMethod() {
this.inner.innerMostMethod();
}
}
class DelegateRecursionInnerMost {
DelegateRecursionInnerMost() {
@@ -23,4 +23,4 @@ class DelegateRecursionInnerMost {
}
public void innerMostMethod() {
}
}
}
@@ -24,13 +24,13 @@ class DelegatePlain {
}
private final @Delegate(types = Bar.class) BarImpl bar = new BarImpl();
private final @Delegate(types = Foo.class,excludes = Bar.class) FooImpl foo = new FooImpl();
DelegatePlain() {
super();
}
public @java.lang.SuppressWarnings("all") void bar(final java.util.ArrayList<java.lang.String> list) {
this.bar.bar(list);
}
public @java.lang.SuppressWarnings("all") void foo() {
this.foo.foo();
}
DelegatePlain() {
super();
}
}
}
@@ -6,6 +6,9 @@ class DelegateWithDeprecated {
void notDeprecated();
}
private @Delegate Bar bar;
DelegateWithDeprecated() {
super();
}
public @java.lang.Deprecated @java.lang.SuppressWarnings("all") void deprecatedAnnotation() {
this.bar.deprecatedAnnotation();
}
@@ -15,7 +18,4 @@ class DelegateWithDeprecated {
public @java.lang.SuppressWarnings("all") void notDeprecated() {
this.bar.notDeprecated();
}
DelegateWithDeprecated() {
super();
}
}
}
@@ -4,6 +4,9 @@
Object[] z;
String a;
String b;
EqualsAndHashCode() {
super();
}
public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) {
if ((o == this))
return true;
@@ -43,15 +46,15 @@
result = ((result * PRIME) + (($b == null) ? 0 : $b.hashCode()));
return result;
}
EqualsAndHashCode() {
super();
}
}
final @lombok.EqualsAndHashCode class EqualsAndHashCode2 {
int x;
long y;
float f;
double d;
EqualsAndHashCode2() {
super();
}
public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) {
if ((o == this))
return true;
@@ -79,11 +82,11 @@ final @lombok.EqualsAndHashCode class EqualsAndHashCode2 {
result = ((result * PRIME) + (int) ($d ^ ($d >>> 32)));
return result;
}
EqualsAndHashCode2() {
super();
}
}
final @lombok.EqualsAndHashCode(callSuper = false) class EqualsAndHashCode3 extends EqualsAndHashCode {
EqualsAndHashCode3() {
super();
}
public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) {
if ((o == this))
return true;
@@ -101,11 +104,11 @@ final @lombok.EqualsAndHashCode(callSuper = false) class EqualsAndHashCode3 exte
int result = 1;
return result;
}
EqualsAndHashCode3() {
super();
}
}
@lombok.EqualsAndHashCode(callSuper = true) class EqualsAndHashCode4 extends EqualsAndHashCode {
EqualsAndHashCode4() {
super();
}
public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) {
if ((o == this))
return true;
@@ -127,7 +130,4 @@ final @lombok.EqualsAndHashCode(callSuper = false) class EqualsAndHashCode3 exte
result = ((result * PRIME) + super.hashCode());
return result;
}
EqualsAndHashCode4() {
super();
}
}
@@ -0,0 +1,25 @@
import lombok.experimental.ExtensionMethod;
@ExtensionMethod({java.util.Arrays.class, ExtensionMethodPlain.Extensions.class}) class ExtensionMethodPlain {
static class Extensions {
Extensions() {
super();
}
public static <T>T or(T obj, T ifNull) {
return ((obj != null) ? obj : ifNull);
}
public static String toTitleCase(String in) {
if (in.isEmpty())
return in;
return (("" + Character.toTitleCase(in.charAt(0))) + in.substring(1).toLowerCase());
}
}
ExtensionMethodPlain() {
super();
}
public String test() {
int[] intArray = {5, 3, 8, 2};
java.util.Arrays.sort(intArray);
String iAmNull = null;
return ExtensionMethodPlain.Extensions.or(iAmNull, ExtensionMethodPlain.Extensions.toTitleCase("hELlO, WORlD!"));
}
}
@@ -10,6 +10,9 @@ class GetterAccessLevel {
@lombok.Getter(lombok.AccessLevel.PROTECTED) String protectedString;
@lombok.Getter(lombok.AccessLevel.PUBLIC) String publicString;
@lombok.Getter(value = lombok.AccessLevel.PUBLIC) String value;
GetterAccessLevel() {
super();
}
private @java.lang.SuppressWarnings("all") boolean isPrivate() {
return this.isPrivate;
}
@@ -37,7 +40,4 @@ class GetterAccessLevel {
public @java.lang.SuppressWarnings("all") String getValue() {
return this.value;
}
GetterAccessLevel() {
super();
}
}
@@ -1,14 +1,14 @@
class Getter1 {
@lombok.Getter boolean foo;
public @java.lang.SuppressWarnings("all") boolean isFoo() {
return this.foo;
}
Getter1() {
super();
}
boolean hasFoo() {
return true;
}
public @java.lang.SuppressWarnings("all") boolean isFoo() {
return this.foo;
}
}
class Getter2 {
@lombok.Getter boolean foo;
@@ -30,27 +30,27 @@ class Getter3 {
}
class Getter4 {
@lombok.Getter String foo;
public @java.lang.SuppressWarnings("all") String getFoo() {
return this.foo;
}
Getter4() {
super();
}
String hasFoo() {
return null;
}
}
class Getter5 {
@lombok.Getter String foo;
public @java.lang.SuppressWarnings("all") String getFoo() {
return this.foo;
}
}
class Getter5 {
@lombok.Getter String foo;
Getter5() {
super();
}
String isFoo() {
return null;
}
public @java.lang.SuppressWarnings("all") String getFoo() {
return this.foo;
}
}
class Getter6 {
@lombok.Getter String foo;
@@ -63,27 +63,27 @@ class Getter6 {
}
class Getter7 {
@lombok.Getter String foo;
public @java.lang.SuppressWarnings("all") String getFoo() {
return this.foo;
}
Getter7() {
super();
}
boolean hasFoo() {
return false;
}
}
class Getter8 {
@lombok.Getter String foo;
public @java.lang.SuppressWarnings("all") String getFoo() {
return this.foo;
}
}
class Getter8 {
@lombok.Getter String foo;
Getter8() {
super();
}
boolean isFoo() {
return false;
}
public @java.lang.SuppressWarnings("all") String getFoo() {
return this.foo;
}
}
class Getter9 {
@lombok.Getter String foo;
@@ -96,15 +96,15 @@ class Getter9 {
}
class Getter10 {
@lombok.Getter boolean foo;
public @java.lang.SuppressWarnings("all") boolean isFoo() {
return this.foo;
}
Getter10() {
super();
}
static boolean hasFoo() {
return false;
}
public @java.lang.SuppressWarnings("all") boolean isFoo() {
return this.foo;
}
}
class Getter11 {
@lombok.Getter boolean foo;
@@ -126,27 +126,27 @@ class Getter12 {
}
class Getter13 {
@lombok.Getter String foo;
public @java.lang.SuppressWarnings("all") String getFoo() {
return this.foo;
}
Getter13() {
super();
}
static boolean hasFoo() {
return false;
}
}
class Getter14 {
@lombok.Getter String foo;
public @java.lang.SuppressWarnings("all") String getFoo() {
return this.foo;
}
}
class Getter14 {
@lombok.Getter String foo;
Getter14() {
super();
}
static boolean isFoo() {
return false;
}
public @java.lang.SuppressWarnings("all") String getFoo() {
return this.foo;
}
}
class Getter15 {
@lombok.Getter String foo;
@@ -159,27 +159,27 @@ class Getter15 {
}
class Getter16 {
@lombok.Getter String foo;
public @java.lang.SuppressWarnings("all") String getFoo() {
return this.foo;
}
Getter16() {
super();
}
static String hasFoo() {
return "";
}
}
class Getter17 {
@lombok.Getter String foo;
public @java.lang.SuppressWarnings("all") String getFoo() {
return this.foo;
}
}
class Getter17 {
@lombok.Getter String foo;
Getter17() {
super();
}
static String isFoo() {
return "";
}
public @java.lang.SuppressWarnings("all") String getFoo() {
return this.foo;
}
}
class Getter18 {
@lombok.Getter String foo;
@@ -2,6 +2,9 @@ class Getter {
@lombok.Getter boolean foo;
@lombok.Getter boolean isBar;
@lombok.Getter boolean hasBaz;
Getter() {
super();
}
public @java.lang.SuppressWarnings("all") boolean isFoo() {
return this.foo;
}
@@ -11,21 +14,18 @@ class Getter {
public @java.lang.SuppressWarnings("all") boolean isHasBaz() {
return this.hasBaz;
}
Getter() {
super();
}
}
class MoreGetter {
@lombok.Getter boolean foo;
public @java.lang.SuppressWarnings("all") boolean isFoo() {
return this.foo;
}
MoreGetter() {
super();
}
boolean hasFoo() {
return true;
}
public @java.lang.SuppressWarnings("all") boolean isFoo() {
return this.foo;
}
}
class YetMoreGetter {
@lombok.Getter boolean foo;
@@ -35,4 +35,4 @@ class YetMoreGetter {
boolean getFoo() {
return true;
}
}
}
@@ -2,13 +2,13 @@ import lombok.Getter;
class GetterDeprecated {
@Deprecated @Getter int annotation;
@Getter int javadoc;
GetterDeprecated() {
super();
}
public @java.lang.Deprecated @java.lang.SuppressWarnings("all") int getAnnotation() {
return this.annotation;
}
public @java.lang.Deprecated @java.lang.SuppressWarnings("all") int getJavadoc() {
return this.javadoc;
}
GetterDeprecated() {
super();
}
}
@@ -7,15 +7,15 @@ import lombok.RequiredArgsConstructor;
private final @Getter String name;
<clinit>() {
}
private @java.lang.SuppressWarnings("all") GetterEnum(final int id, final String name) {
super();
this.id = id;
this.name = name;
}
public @java.lang.SuppressWarnings("all") int getId() {
return this.id;
}
public @java.lang.SuppressWarnings("all") String getName() {
return this.name;
}
}
private @java.lang.SuppressWarnings("all") GetterEnum(final int id, final String name) {
super();
this.id = id;
this.name = name;
}
}
@@ -5,6 +5,9 @@ class GetterLazy {
}
}
private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<ValueType>> fieldName = new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<ValueType>>();
GetterLazy() {
super();
}
public @java.lang.SuppressWarnings("all") ValueType getFieldName() {
java.util.concurrent.atomic.AtomicReference<ValueType> value = this.fieldName.get();
if ((value == null))
@@ -22,7 +25,4 @@ class GetterLazy {
}
return value.get();
}
GetterLazy() {
super();
}
}
@@ -1,6 +1,12 @@
@lombok.EqualsAndHashCode(of = "booleanValue") @lombok.ToString(of = "booleanValue") class GetterLazyBoolean {
private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Boolean>> booleanValue = new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Boolean>>();
private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Boolean>> otherBooleanValue = new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Boolean>>();
GetterLazyBoolean() {
super();
}
private static boolean calculateBoolean() {
return true;
}
public @java.lang.SuppressWarnings("all") boolean isBooleanValue() {
java.util.concurrent.atomic.AtomicReference<java.lang.Boolean> value = this.booleanValue.get();
if ((value == null))
@@ -59,10 +65,4 @@
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return (("GetterLazyBoolean(booleanValue=" + this.isBooleanValue()) + ")");
}
GetterLazyBoolean() {
super();
}
private static boolean calculateBoolean() {
return true;
}
}
@@ -1,6 +1,9 @@
@lombok.EqualsAndHashCode(doNotUseGetters = true) @lombok.ToString(doNotUseGetters = true) class GetterLazyEahcToString {
private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<String>> value = new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<String>>();
private final @lombok.Getter String value2 = "";
GetterLazyEahcToString() {
super();
}
public @java.lang.SuppressWarnings("all") String getValue() {
java.util.concurrent.atomic.AtomicReference<String> value = this.value.get();
if ((value == null))
@@ -54,7 +57,4 @@
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return (((("GetterLazyEahcToString(value=" + this.getValue()) + ", value2=") + this.value2) + ")");
}
GetterLazyEahcToString() {
super();
}
}
}
@@ -24,12 +24,12 @@ class GetterLazyInvalidNone {
}
@lombok.Getter(lazy = true) class GetterLazyInvalidClass {
private final String fieldName = "";
public @java.lang.SuppressWarnings("all") String getFieldName() {
return this.fieldName;
}
GetterLazyInvalidClass() {
super();
}
public @java.lang.SuppressWarnings("all") String getFieldName() {
return this.fieldName;
}
}
class GetterLazyInvalidNoInit {
private final @lombok.Getter(lazy = true) String fieldName;
@@ -37,4 +37,4 @@ class GetterLazyInvalidNoInit {
super();
this.fieldName = "foo";
}
}
}
@@ -8,6 +8,9 @@ class GetterLazyNative {
private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Double>> doubleField = new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Double>>();
private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Character>> charField = new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Character>>();
private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<int[]>> intArrayField = new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<int[]>>();
GetterLazyNative() {
super();
}
public @java.lang.SuppressWarnings("all") boolean isBooleanField() {
java.util.concurrent.atomic.AtomicReference<java.lang.Boolean> value = this.booleanField.get();
if ((value == null))
@@ -161,7 +164,4 @@ class GetterLazyNative {
}
return value.get();
}
GetterLazyNative() {
super();
}
}
}
@@ -3,10 +3,10 @@ import lombok.Getter;
@Getter class GetterNone {
int i;
@Getter(AccessLevel.NONE) int foo;
public @java.lang.SuppressWarnings("all") int getI() {
return this.i;
}
GetterNone() {
super();
}
}
public @java.lang.SuppressWarnings("all") int getI() {
return this.i;
}
}
@@ -1,68 +1,67 @@
@lombok.Getter class GetterOnClass1 {
@lombok.Getter(lombok.AccessLevel.NONE) boolean isNone;
boolean isPublic;
public @java.lang.SuppressWarnings("all") boolean isPublic() {
return this.isPublic;
}
GetterOnClass1() {
super();
}
public @java.lang.SuppressWarnings("all") boolean isPublic() {
return this.isPublic;
}
}
@lombok.Getter(lombok.AccessLevel.PROTECTED) class GetterOnClass2 {
@lombok.Getter(lombok.AccessLevel.NONE) boolean isNone;
boolean isProtected;
@lombok.Getter(lombok.AccessLevel.PACKAGE) boolean isPackage;
GetterOnClass2() {
super();
}
@java.lang.SuppressWarnings("all") boolean isPackage() {
return this.isPackage;
}
protected @java.lang.SuppressWarnings("all") boolean isProtected() {
return this.isProtected;
}
GetterOnClass2() {
super();
}
}
@lombok.Getter(lombok.AccessLevel.PACKAGE) class GetterOnClass3 {
@lombok.Getter(lombok.AccessLevel.NONE) boolean isNone;
boolean isPackage;
@java.lang.SuppressWarnings("all") boolean isPackage() {
return this.isPackage;
}
GetterOnClass3() {
super();
}
@java.lang.SuppressWarnings("all") boolean isPackage() {
return this.isPackage;
}
}
@lombok.Getter(lombok.AccessLevel.PRIVATE) class GetterOnClass4 {
@lombok.Getter(lombok.AccessLevel.NONE) boolean isNone;
boolean isPrivate;
private @java.lang.SuppressWarnings("all") boolean isPrivate() {
return this.isPrivate;
}
GetterOnClass4() {
super();
}
private @java.lang.SuppressWarnings("all") boolean isPrivate() {
return this.isPrivate;
}
}
@lombok.Getter(lombok.AccessLevel.PUBLIC) class GetterOnClass5 {
@lombok.Getter(lombok.AccessLevel.NONE) boolean isNone;
boolean isPublic;
public @java.lang.SuppressWarnings("all") boolean isPublic() {
return this.isPublic;
}
GetterOnClass5() {
super();
}
public @java.lang.SuppressWarnings("all") boolean isPublic() {
return this.isPublic;
}
}
@lombok.Getter class GetterOnClass6 {
String couldBeNull;
@lombok.NonNull String nonNull;
GetterOnClass6() {
super();
}
public @java.lang.SuppressWarnings("all") String getCouldBeNull() {
return this.couldBeNull;
}
public @lombok.NonNull @java.lang.SuppressWarnings("all") String getNonNull() {
return this.nonNull;
}
GetterOnClass6() {
super();
}
}
}
@@ -3,13 +3,13 @@ class Getter {
static @lombok.Getter int bar;
<clinit>() {
}
Getter() {
super();
}
public static @java.lang.SuppressWarnings("all") boolean isFoo() {
return Getter.foo;
}
public static @java.lang.SuppressWarnings("all") int getBar() {
return Getter.bar;
}
Getter() {
super();
}
}
@@ -2,13 +2,13 @@ import lombok.Getter;
class GetterPlain {
@lombok.Getter int i;
@Getter int foo;
GetterPlain() {
super();
}
public @java.lang.SuppressWarnings("all") int getI() {
return this.i;
}
public @java.lang.SuppressWarnings("all") int getFoo() {
return this.foo;
}
GetterPlain() {
super();
}
}
}
@@ -1,22 +1,22 @@
class GetterWithDollar1 {
@lombok.Getter int $i;
public @java.lang.SuppressWarnings("all") int get$i() {
return this.$i;
}
GetterWithDollar1() {
super();
}
public @java.lang.SuppressWarnings("all") int get$i() {
return this.$i;
}
}
class GetterWithDollar2 {
@lombok.Getter int $i;
@lombok.Getter int i;
GetterWithDollar2() {
super();
}
public @java.lang.SuppressWarnings("all") int get$i() {
return this.$i;
}
public @java.lang.SuppressWarnings("all") int getI() {
return this.i;
}
GetterWithDollar2() {
super();
}
}
@@ -3,26 +3,26 @@ import lombok.AccessLevel;
class MultiFieldGetter {
@Getter(AccessLevel.PROTECTED) int x;
@Getter(AccessLevel.PROTECTED) int y;
MultiFieldGetter() {
super();
}
protected @java.lang.SuppressWarnings("all") int getX() {
return this.x;
}
protected @java.lang.SuppressWarnings("all") int getY() {
return this.y;
}
MultiFieldGetter() {
super();
}
}
@Getter class MultiFieldGetter2 {
@Getter(AccessLevel.PACKAGE) int x;
@Getter(AccessLevel.PACKAGE) int y;
MultiFieldGetter2() {
super();
}
@java.lang.SuppressWarnings("all") int getX() {
return this.x;
}
@java.lang.SuppressWarnings("all") int getY() {
return this.y;
}
MultiFieldGetter2() {
super();
}
}
}
@@ -5,6 +5,9 @@ class SetterAccessLevel {
@lombok.Setter(lombok.AccessLevel.PROTECTED) boolean isProtected;
@lombok.Setter(lombok.AccessLevel.PUBLIC) boolean isPublic;
@lombok.Setter(value = lombok.AccessLevel.PUBLIC) boolean value;
SetterAccessLevel() {
super();
}
private @java.lang.SuppressWarnings("all") void setPrivate(final boolean isPrivate) {
this.isPrivate = isPrivate;
}
@@ -20,7 +23,4 @@ class SetterAccessLevel {
public @java.lang.SuppressWarnings("all") void setValue(final boolean value) {
this.value = value;
}
SetterAccessLevel() {
super();
}
}
@@ -32,25 +32,25 @@ class Setter4 {
}
class Setter5 {
@lombok.Setter String foo;
public @java.lang.SuppressWarnings("all") void setFoo(final String foo) {
this.foo = foo;
}
Setter5() {
super();
}
void setFoo() {
}
}
class Setter6 {
@lombok.Setter String foo;
public @java.lang.SuppressWarnings("all") void setFoo(final String foo) {
this.foo = foo;
}
}
class Setter6 {
@lombok.Setter String foo;
Setter6() {
super();
}
void setFoo(String foo, int x) {
}
public @java.lang.SuppressWarnings("all") void setFoo(final String foo) {
this.foo = foo;
}
}
class Setter7 {
@lombok.Setter String foo;
@@ -75,4 +75,4 @@ class Setter9 {
}
void setFoo(boolean foo) {
}
}
}
@@ -2,13 +2,13 @@ import lombok.Setter;
class SetterDeprecated {
@Deprecated @Setter int annotation;
@Setter int javadoc;
SetterDeprecated() {
super();
}
public @java.lang.Deprecated @java.lang.SuppressWarnings("all") void setAnnotation(final int annotation) {
this.annotation = annotation;
}
public @java.lang.Deprecated @java.lang.SuppressWarnings("all") void setJavadoc(final int javadoc) {
this.javadoc = javadoc;
}
SetterDeprecated() {
super();
}
}
@@ -1,60 +1,63 @@
@lombok.Setter class SetterOnClass1 {
@lombok.Setter(lombok.AccessLevel.NONE) boolean isNone;
boolean isPublic;
public @java.lang.SuppressWarnings("all") void setPublic(final boolean isPublic) {
this.isPublic = isPublic;
}
SetterOnClass1() {
super();
}
public @java.lang.SuppressWarnings("all") void setPublic(final boolean isPublic) {
this.isPublic = isPublic;
}
}
@lombok.Setter(lombok.AccessLevel.PROTECTED) class SetterOnClass2 {
@lombok.Setter(lombok.AccessLevel.NONE) boolean isNone;
boolean isProtected;
@lombok.Setter(lombok.AccessLevel.PACKAGE) boolean isPackage;
SetterOnClass2() {
super();
}
@java.lang.SuppressWarnings("all") void setPackage(final boolean isPackage) {
this.isPackage = isPackage;
}
protected @java.lang.SuppressWarnings("all") void setProtected(final boolean isProtected) {
this.isProtected = isProtected;
}
SetterOnClass2() {
super();
}
}
@lombok.Setter(lombok.AccessLevel.PACKAGE) class SetterOnClass3 {
@lombok.Setter(lombok.AccessLevel.NONE) boolean isNone;
boolean isPackage;
@java.lang.SuppressWarnings("all") void setPackage(final boolean isPackage) {
this.isPackage = isPackage;
}
SetterOnClass3() {
super();
}
@java.lang.SuppressWarnings("all") void setPackage(final boolean isPackage) {
this.isPackage = isPackage;
}
}
@lombok.Setter(lombok.AccessLevel.PRIVATE) class SetterOnClass4 {
@lombok.Setter(lombok.AccessLevel.NONE) boolean isNone;
boolean isPrivate;
private @java.lang.SuppressWarnings("all") void setPrivate(final boolean isPrivate) {
this.isPrivate = isPrivate;
}
SetterOnClass4() {
super();
}
private @java.lang.SuppressWarnings("all") void setPrivate(final boolean isPrivate) {
this.isPrivate = isPrivate;
}
}
@lombok.Setter(lombok.AccessLevel.PUBLIC) class SetterOnClass5 {
@lombok.Setter(lombok.AccessLevel.NONE) boolean isNone;
boolean isPublic;
public @java.lang.SuppressWarnings("all") void setPublic(final boolean isPublic) {
this.isPublic = isPublic;
}
SetterOnClass5() {
super();
}
public @java.lang.SuppressWarnings("all") void setPublic(final boolean isPublic) {
this.isPublic = isPublic;
}
}
@lombok.Setter class SetterOnClass6 {
String couldBeNull;
@lombok.NonNull String nonNull;
SetterOnClass6() {
super();
}
public @java.lang.SuppressWarnings("all") void setCouldBeNull(final String couldBeNull) {
this.couldBeNull = couldBeNull;
}
@@ -63,7 +66,4 @@
throw new java.lang.NullPointerException("nonNull");
this.nonNull = nonNull;
}
SetterOnClass6() {
super();
}
}
@@ -3,13 +3,13 @@ class Setter {
static @lombok.Setter int bar;
<clinit>() {
}
Setter() {
super();
}
public static @java.lang.SuppressWarnings("all") void setFoo(final boolean foo) {
Setter.foo = foo;
}
public static @java.lang.SuppressWarnings("all") void setBar(final int bar) {
Setter.bar = bar;
}
Setter() {
super();
}
}
@@ -2,13 +2,13 @@ import lombok.Setter;
class SetterPlain {
@lombok.Setter int i;
@Setter int foo;
SetterPlain() {
super();
}
public @java.lang.SuppressWarnings("all") void setI(final int i) {
this.i = i;
}
public @java.lang.SuppressWarnings("all") void setFoo(final int foo) {
this.foo = foo;
}
SetterPlain() {
super();
}
}
}
@@ -1,22 +1,22 @@
class SetterWithDollar1 {
@lombok.Setter int $i;
public @java.lang.SuppressWarnings("all") void set$i(final int $i) {
this.$i = $i;
}
SetterWithDollar1() {
super();
}
public @java.lang.SuppressWarnings("all") void set$i(final int $i) {
this.$i = $i;
}
}
class SetterWithDollar2 {
@lombok.Setter int $i;
@lombok.Setter int i;
SetterWithDollar2() {
super();
}
public @java.lang.SuppressWarnings("all") void set$i(final int $i) {
this.$i = $i;
}
public @java.lang.SuppressWarnings("all") void setI(final int i) {
this.i = i;
}
SetterWithDollar2() {
super();
}
}
@@ -5,9 +5,9 @@ class SimpleTypeResolutionFail {
}
class SimpleTypeResolutionSuccess {
private @lombok.Getter int x;
SimpleTypeResolutionSuccess() {
}
public @java.lang.SuppressWarnings("all") int getX() {
return this.x;
}
SimpleTypeResolutionSuccess() {
}
}
@@ -12,15 +12,6 @@ class SynchronizedName {
System.out.println("one");
}
}
@lombok.Synchronized("write") void test2() {
System.out.println("two");
}
static @lombok.Synchronized("read") void test3() {
synchronized (SynchronizedName.read)
{
System.out.println("three");
}
}
@lombok.Synchronized("READ") void test4() {
synchronized (this.READ)
{
@@ -33,4 +24,4 @@ class SynchronizedName {
System.out.println("five");
}
}
}
}
@@ -0,0 +1,12 @@
class SynchronizedNameNoSuchField {
private Object read = new Object();
private static Object READ = new Object();
<clinit>() {
}
SynchronizedNameNoSuchField() {
super();
}
@lombok.Synchronized("write") void test2() {
System.out.println("two");
}
}
@@ -0,0 +1,15 @@
class SynchronizedNameStaticToInstanceRef {
private Object read = new Object();
private static Object READ = new Object();
<clinit>() {
}
SynchronizedNameStaticToInstanceRef() {
super();
}
static @lombok.Synchronized("read") void test3() {
synchronized (SynchronizedNameStaticToInstanceRef.read)
{
System.out.println("three");
}
}
}
@@ -2,31 +2,31 @@ import lombok.ToString;
@ToString class ToStringOuter {
@ToString class ToStringInner {
int y;
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return (("ToStringOuter.ToStringInner(y=" + this.y) + ")");
}
ToStringInner() {
super();
}
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return (("ToStringOuter.ToStringInner(y=" + this.y) + ")");
}
}
static @ToString class ToStringStaticInner {
int y;
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return (("ToStringOuter.ToStringStaticInner(y=" + this.y) + ")");
}
ToStringStaticInner() {
super();
}
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return (("ToStringOuter.ToStringStaticInner(y=" + this.y) + ")");
}
}
class ToStringMiddle {
@ToString class ToStringMoreInner {
String name;
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return (("ToStringOuter.ToStringMiddle.ToStringMoreInner(name=" + this.name) + ")");
}
ToStringMoreInner() {
super();
}
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return (("ToStringOuter.ToStringMiddle.ToStringMoreInner(name=" + this.name) + ")");
}
}
ToStringMiddle() {
super();
@@ -34,10 +34,10 @@ import lombok.ToString;
}
int x;
String name;
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return (((("ToStringOuter(x=" + this.x) + ", name=") + this.name) + ")");
}
ToStringOuter() {
super();
}
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return (((("ToStringOuter(x=" + this.x) + ", name=") + this.name) + ")");
}
}
@@ -2,20 +2,20 @@ import lombok.ToString;
@lombok.ToString class ToString1 {
int x;
String name;
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return (((("ToString1(x=" + this.x) + ", name=") + this.name) + ")");
}
ToString1() {
super();
}
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return (((("ToString1(x=" + this.x) + ", name=") + this.name) + ")");
}
}
@ToString class ToString2 {
int x;
String name;
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return (((("ToString2(x=" + this.x) + ", name=") + this.name) + ")");
}
ToString2() {
super();
}
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return (((("ToString2(x=" + this.x) + ", name=") + this.name) + ")");
}
}
@@ -17,12 +17,12 @@ class TrickyDoNothing2 {
}
class TrickySuccess {
@Getter int x;
public @java.lang.SuppressWarnings("all") int getX() {
return this.x;
}
TrickySuccess() {
super();
}
public @java.lang.SuppressWarnings("all") int getX() {
return this.x;
}
}
class TrickyDoNothing3 {
TrickyDoNothing3() {
@@ -84,4 +84,4 @@ class DoubleTrickyDoSomething {
final @val java.lang.Object y = null;
}
}
}
}
@@ -0,0 +1,4 @@
@lombok.Data(staticConstructor="of")
@lombok.NoArgsConstructor
class ConflictingStaticConstructorNames {
}
@@ -22,3 +22,7 @@
final T x;
String name;
}
@lombok.RequiredArgsConstructor(staticName="of") class RequiredArgsConstructorStaticNameGenerics2<T extends Number> {
final Class<T> x;
String name;
}
@@ -0,0 +1,23 @@
import lombok.experimental.ExtensionMethod;
@ExtensionMethod({java.util.Arrays.class, ExtensionMethodPlain.Extensions.class})
class ExtensionMethodPlain {
public String test() {
int[] intArray = {5, 3, 8, 2};
intArray.sort();
String iAmNull = null;
return iAmNull.or("hELlO, WORlD!".toTitleCase());
}
static class Extensions {
public static <T> T or(T obj, T ifNull) {
return obj != null ? obj : ifNull;
}
public static String toTitleCase(String in) {
if (in.isEmpty()) return in;
return "" + Character.toTitleCase(in.charAt(0)) + in.substring(1).toLowerCase();
}
}
}
@@ -5,12 +5,6 @@ class SynchronizedName {
@lombok.Synchronized("read") void test1() {
System.out.println("one");
}
@lombok.Synchronized("write") void test2() {
System.out.println("two");
}
@lombok.Synchronized("read") static void test3() {
System.out.println("three");
}
@lombok.Synchronized("READ") void test4() {
System.out.println("four");
}
@@ -0,0 +1,8 @@
class SynchronizedNameNoSuchField {
private Object read = new Object();
private static Object READ = new Object();
@lombok.Synchronized("write") void test2() {
System.out.println("two");
}
}
@@ -0,0 +1,8 @@
class SynchronizedNameStaticToInstanceRef {
private Object read = new Object();
private static Object READ = new Object();
@lombok.Synchronized("read") static void test3() {
System.out.println("three");
}
}
@@ -0,0 +1 @@
1:1 WARNING Ignoring static constructor name: explicit @XxxArgsConstructor annotation present; its `staticName` parameter will be used.
@@ -1 +0,0 @@
8:9 ERROR The field write does not exist.
@@ -0,0 +1 @@
5:9 ERROR The field write does not exist.
@@ -0,0 +1 @@
5:9 ERROR non-static variable read cannot be referenced from a static context
@@ -0,0 +1 @@
1 warning Ignoring static constructor name: explicit @XxxArgsConstructor annotation present; its `staticName` parameter will be used.
@@ -1,2 +1 @@
8 error The field write does not exist.
11 error Cannot make a static reference to the non-static field SynchronizedName.read
8 warning The static field SynchronizedName.READ should be accessed in a static way
@@ -0,0 +1 @@
5 error The field write does not exist.
@@ -0,0 +1 @@
5 error Cannot make a static reference to the non-static field SynchronizedNameStaticToInstanceRef.read
@@ -0,0 +1 @@
5:66 ERROR non-static variable read cannot be referenced from a static context
@@ -0,0 +1,7 @@
3:44 ERROR cannot find symbol
symbol : variable d
location: class ValErrors
6:17 ERROR cannot find symbol
symbol : class val
location: class ValErrors
6:25 ERROR illegal initializer for <none>