mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-14 08:18:29 +00:00
Added a test infrastructure that simulates eclipse with diet-parse, type-binding and so forth. Similar to eclipse, the test needs to be executed with lombok as vm-agent. @Delegate runs with this setup, sadly val does not, at least for now.
And as expected the tests shows that @Synchronized and @SneakyThrows are currently broken for eclipse but not for ecj.
This commit is contained in:
1 parent
aa96fcbc77
commit
850c3eaf07
72 files changed
+2570
-1
No files matched your search
@@ -37,7 +37,7 @@ import org.junit.runner.notification.RunNotifier;
|
||||
|
||||
public class DirectoryRunner extends Runner {
|
||||
public enum Compiler {
|
||||
DELOMBOK, JAVAC, ECJ;
|
||||
DELOMBOK, JAVAC, ECJ, ECLIPSE;
|
||||
}
|
||||
|
||||
public interface TestParams {
|
||||
@@ -119,6 +119,8 @@ public class DirectoryRunner extends Runner {
|
||||
switch (params.getCompiler()) {
|
||||
case DELOMBOK:
|
||||
return new RunTestsViaDelombok().compareFile(params, file);
|
||||
case ECLIPSE:
|
||||
return new RunTestsViaEclipse().compareFile(params, file);
|
||||
case ECJ:
|
||||
return new RunTestsViaEcj().compareFile(params, file);
|
||||
default:
|
||||
|
||||
@@ -0,0 +1,304 @@
|
||||
/*
|
||||
* Copyright © 2011 Reinier Zwitserloot and Roel Spilker.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
package lombok;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.StringWriter;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.jdt.core.compiler.CategorizedProblem;
|
||||
import org.eclipse.jdt.internal.compiler.Compiler;
|
||||
import org.eclipse.jdt.internal.compiler.CompilationResult;
|
||||
import org.eclipse.jdt.internal.compiler.DefaultErrorHandlingPolicies;
|
||||
import org.eclipse.jdt.internal.compiler.ICompilerRequestor;
|
||||
import org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy;
|
||||
import org.eclipse.jdt.internal.compiler.IProblemFactory;
|
||||
import org.eclipse.jdt.internal.compiler.ISourceElementRequestor;
|
||||
import org.eclipse.jdt.internal.compiler.SourceElementParser;
|
||||
import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;
|
||||
import org.eclipse.jdt.internal.compiler.ast.Expression;
|
||||
import org.eclipse.jdt.internal.compiler.ast.ImportReference;
|
||||
import org.eclipse.jdt.internal.compiler.batch.CompilationUnit;
|
||||
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
|
||||
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader;
|
||||
import org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException;
|
||||
import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
|
||||
import org.eclipse.jdt.internal.compiler.env.INameEnvironment;
|
||||
import org.eclipse.jdt.internal.compiler.env.NameEnvironmentAnswer;
|
||||
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
|
||||
import org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory;
|
||||
|
||||
/**
|
||||
* Simulates more or less what happens in eclipse
|
||||
*/
|
||||
public class RunTestsViaEclipse extends AbstractRunTests {
|
||||
protected static CompilerOptions ecjCompilerOptions() {
|
||||
CompilerOptions options = new CompilerOptions();
|
||||
options.complianceLevel = ClassFileConstants.JDK1_6;
|
||||
options.sourceLevel = ClassFileConstants.JDK1_6;
|
||||
options.targetJDK = ClassFileConstants.JDK1_6;
|
||||
options.parseLiteralExpressionsAsConstants = true;
|
||||
return options;
|
||||
}
|
||||
|
||||
@Override public void transformCode(final StringBuilder messages, StringWriter result, File file) throws Throwable {
|
||||
String source = readFile(file);
|
||||
CompilationUnit sourceUnit = new CompilationUnit(source.toCharArray(), file.getName(), "UTF-8");
|
||||
IErrorHandlingPolicy policy = DefaultErrorHandlingPolicies.proceedWithAllProblems();
|
||||
IProblemFactory problemFactory = new DefaultProblemFactory(Locale.ENGLISH);
|
||||
INameEnvironment nameEnvironment = new LombokTestNameEnvironment();
|
||||
ICompilerRequestor compilerRequestor = new LombokTestCompilerRequestor();
|
||||
CompilerOptions options = ecjCompilerOptions();
|
||||
|
||||
|
||||
ISourceElementRequestor sourceElementRequestor = new LombokTestSourceElementRequestor();
|
||||
SourceElementParser parser = new SourceElementParser(sourceElementRequestor, problemFactory, options, true, true);
|
||||
final CompilationUnitDeclaration cud = parser.parseCompilationUnit(sourceUnit, true, null);
|
||||
|
||||
final LombokTestCompiler jdtCompiler = new LombokTestCompiler(nameEnvironment, policy, options, compilerRequestor, problemFactory);
|
||||
jdtCompiler.lookupEnvironment.buildTypeBindings(cud, null);
|
||||
jdtCompiler.lookupEnvironment.completeTypeBindings(cud, true);
|
||||
|
||||
CategorizedProblem[] problems = cud.compilationResult.getAllProblems();
|
||||
|
||||
if (problems != null) for (CategorizedProblem p : problems) {
|
||||
messages.append(String.format("%d %s %s\n", p.getSourceLineNumber(), p.isError() ? "error" : p.isWarning() ? "warning" : "unknown", p.getMessage()));
|
||||
}
|
||||
|
||||
result.append(cud.toString());
|
||||
}
|
||||
|
||||
private static class LombokTestCompiler extends Compiler {
|
||||
public LombokTestCompiler(INameEnvironment nameEnvironment, IErrorHandlingPolicy policy, CompilerOptions ecjCompilerOptions, ICompilerRequestor requestor, IProblemFactory problemFactory) {
|
||||
super(nameEnvironment, policy, ecjCompilerOptions, requestor, problemFactory);
|
||||
}
|
||||
|
||||
@Override protected void handleInternalException(Throwable e, CompilationUnitDeclaration ud, CompilationResult result) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
@Override public void beginToCompile(ICompilationUnit[] sourceUnits) {
|
||||
super.beginToCompile(sourceUnits);
|
||||
}
|
||||
};
|
||||
|
||||
private static class LombokTestCompilerRequestor implements ICompilerRequestor {
|
||||
public void acceptResult(CompilationResult result) {
|
||||
}
|
||||
}
|
||||
|
||||
private static class LombokTestSourceElementRequestor implements ISourceElementRequestor {
|
||||
|
||||
@Override public void acceptAnnotationTypeReference(char[][] annotation, int sourceStart, int sourceEnd) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override public void acceptAnnotationTypeReference(char[] annotation, int sourcePosition) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override public void acceptConstructorReference(char[] typeName, int argCount, int sourcePosition) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override public void acceptFieldReference(char[] fieldName, int sourcePosition) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override public void acceptImport(int declarationStart, int declarationEnd, char[][] tokens, boolean onDemand, int modifiers) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override public void acceptLineSeparatorPositions(int[] positions) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override public void acceptMethodReference(char[] methodName, int argCount, int sourcePosition) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override public void acceptPackage(ImportReference importReference) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override public void acceptProblem(CategorizedProblem problem) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override public void acceptTypeReference(char[][] typeName, int sourceStart, int sourceEnd) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override public void acceptTypeReference(char[] typeName, int sourcePosition) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override public void acceptUnknownReference(char[][] name, int sourceStart, int sourceEnd) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override public void acceptUnknownReference(char[] name, int sourcePosition) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override public void enterCompilationUnit() {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override public void enterConstructor(MethodInfo methodInfo) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override public void enterField(FieldInfo fieldInfo) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override public void enterInitializer(int declarationStart, int modifiers) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override public void enterMethod(MethodInfo methodInfo) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override public void enterType(TypeInfo typeInfo) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override public void exitCompilationUnit(int declarationEnd) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override public void exitConstructor(int declarationEnd) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override public void exitField(int initializationStart, int declarationEnd, int declarationSourceEnd) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override public void exitInitializer(int declarationEnd) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override public void exitMethod(int declarationEnd, Expression defaultValue) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override public void exitType(int declarationEnd) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
|
||||
private static class LombokTestNameEnvironment implements INameEnvironment {
|
||||
Map<String, Boolean> packagesCache = new HashMap<String, Boolean>();
|
||||
|
||||
public NameEnvironmentAnswer findType(final char[][] compoundTypeName) {
|
||||
final StringBuffer result = new StringBuffer();
|
||||
for (int i = 0; i < compoundTypeName.length; i++) {
|
||||
if (i != 0) {
|
||||
result.append('.');
|
||||
}
|
||||
result.append(compoundTypeName[i]);
|
||||
}
|
||||
return findType(result.toString());
|
||||
}
|
||||
|
||||
public NameEnvironmentAnswer findType(final char[] typeName, final char[][] packageName) {
|
||||
final StringBuffer result = new StringBuffer();
|
||||
for (int i = 0; i < packageName.length; i++) {
|
||||
result.append(packageName[i]);
|
||||
result.append('.');
|
||||
}
|
||||
result.append(typeName);
|
||||
return findType(result.toString());
|
||||
}
|
||||
|
||||
protected byte[] getClassDefinition(String name) {
|
||||
name = name.replace(".", "/") + ".class";
|
||||
InputStream is = this.getClass().getClassLoader().getResourceAsStream(name);
|
||||
if (is == null) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
||||
byte[] buffer = new byte[8192];
|
||||
int count;
|
||||
while ((count = is.read(buffer, 0, buffer.length)) > 0) {
|
||||
os.write(buffer, 0, count);
|
||||
}
|
||||
return os.toByteArray();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
try {
|
||||
is.close();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private NameEnvironmentAnswer findType(final String name) {
|
||||
try {
|
||||
byte[] bytes = getClassDefinition(name);
|
||||
if (bytes != null) {
|
||||
ClassFileReader classFileReader;
|
||||
classFileReader = new ClassFileReader(bytes, name.toCharArray(), true);
|
||||
return new NameEnvironmentAnswer(classFileReader, null);
|
||||
}
|
||||
return null;
|
||||
} catch (ClassFormatException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isPackage(char[][] parentPackageName, char[] packageName) {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
if (parentPackageName != null) {
|
||||
for (char[] p : parentPackageName) {
|
||||
sb.append(p).append("/");
|
||||
}
|
||||
}
|
||||
sb.append(packageName);
|
||||
String name = sb.toString();
|
||||
if (packagesCache.containsKey(name)) {
|
||||
return packagesCache.get(name).booleanValue();
|
||||
}
|
||||
byte[] bytes = getClassDefinition(name);
|
||||
if (bytes != null) {
|
||||
packagesCache.put(name, false);
|
||||
return false;
|
||||
}
|
||||
packagesCache.put(name, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void cleanup() {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class GetFoo {
|
||||
private @lombok.Getter int foo;
|
||||
public @java.lang.SuppressWarnings("all") int getFoo() {
|
||||
return this.foo;
|
||||
}
|
||||
GetFoo() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
class CleanupName {
|
||||
CleanupName() {
|
||||
super();
|
||||
}
|
||||
void test() {
|
||||
@lombok.Cleanup("toString") Object o = "Hello World!";
|
||||
try
|
||||
{
|
||||
System.out.println(o);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if ((java.util.Collections.singletonList(o).get(0) != null))
|
||||
{
|
||||
o.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
void test2() {
|
||||
@lombok.Cleanup(value = "toString") Object o = "Hello World too!";
|
||||
try
|
||||
{
|
||||
System.out.println(o);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if ((java.util.Collections.singletonList(o).get(0) != null))
|
||||
{
|
||||
o.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import lombok.Cleanup;
|
||||
import java.io.*;
|
||||
class CleanupPlain {
|
||||
CleanupPlain() {
|
||||
super();
|
||||
}
|
||||
void test() throws Exception {
|
||||
@lombok.Cleanup InputStream in = new FileInputStream("in");
|
||||
try
|
||||
{
|
||||
@Cleanup OutputStream out = new FileOutputStream("out");
|
||||
try
|
||||
{
|
||||
if (in.markSupported())
|
||||
{
|
||||
out.flush();
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
if ((java.util.Collections.singletonList(out).get(0) != null))
|
||||
{
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
if ((java.util.Collections.singletonList(in).get(0) != null))
|
||||
{
|
||||
in.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
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();
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
@lombok.RequiredArgsConstructor class RequiredArgsConstructor1 {
|
||||
final int x;
|
||||
String name;
|
||||
public @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") RequiredArgsConstructor1(final int x) {
|
||||
super();
|
||||
this.x = x;
|
||||
}
|
||||
}
|
||||
|
||||
@lombok.RequiredArgsConstructor(access = lombok.AccessLevel.PROTECTED) class RequiredArgsConstructorAccess {
|
||||
final int x;
|
||||
String name;
|
||||
protected @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") RequiredArgsConstructorAccess(final int x) {
|
||||
super();
|
||||
this.x = x;
|
||||
}
|
||||
}
|
||||
|
||||
@lombok.RequiredArgsConstructor(staticName = "staticname") class RequiredArgsConstructorStaticName {
|
||||
final int x;
|
||||
String name;
|
||||
private @java.lang.SuppressWarnings("all") RequiredArgsConstructorStaticName(final int x) {
|
||||
super();
|
||||
this.x = x;
|
||||
}
|
||||
public static @java.lang.SuppressWarnings("all") RequiredArgsConstructorStaticName staticname(final int x) {
|
||||
return new RequiredArgsConstructorStaticName(x);
|
||||
}
|
||||
}
|
||||
|
||||
@lombok.RequiredArgsConstructor() class RequiredArgsConstructorWithAnnotations {
|
||||
final int x;
|
||||
String name;
|
||||
public @Deprecated @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") RequiredArgsConstructorWithAnnotations(final int x) {
|
||||
super();
|
||||
this.x = x;
|
||||
}
|
||||
}
|
||||
|
||||
@lombok.AllArgsConstructor class AllArgsConstructor1 {
|
||||
final int x;
|
||||
String name;
|
||||
public @java.beans.ConstructorProperties({"x", "name"}) @java.lang.SuppressWarnings("all") AllArgsConstructor1(final int x, final String name) {
|
||||
super();
|
||||
this.x = x;
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
|
||||
@lombok.NoArgsConstructor class NoArgsConstructor1 {
|
||||
final int x;
|
||||
String name;
|
||||
public @java.lang.SuppressWarnings("all") NoArgsConstructor1() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
@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;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") void setX(final int x) {
|
||||
this.x = x;
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) {
|
||||
if ((o == this))
|
||||
return true;
|
||||
if ((! (o instanceof DataExtended)))
|
||||
return false;
|
||||
final DataExtended other = (DataExtended) o;
|
||||
if ((! other.canEqual((java.lang.Object) this)))
|
||||
return false;
|
||||
if ((this.getX() != other.getX()))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) {
|
||||
return (other instanceof DataExtended);
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() {
|
||||
final int PRIME = 31;
|
||||
int result = 1;
|
||||
result = ((result * PRIME) + this.getX());
|
||||
return result;
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
|
||||
return (("DataExtended(x=" + this.x) + ")");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
@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;
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) {
|
||||
if ((o == this))
|
||||
return true;
|
||||
if ((! (o instanceof DataIgnore)))
|
||||
return false;
|
||||
final DataIgnore other = (DataIgnore) o;
|
||||
if ((! other.canEqual((java.lang.Object) this)))
|
||||
return false;
|
||||
if ((this.getX() != other.getX()))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) {
|
||||
return (other instanceof DataIgnore);
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() {
|
||||
final int PRIME = 31;
|
||||
int result = 1;
|
||||
result = ((result * PRIME) + this.getX());
|
||||
return result;
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
|
||||
return (("DataIgnore(x=" + this.getX()) + ")");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
public @lombok.Getter @lombok.ToString @lombok.RequiredArgsConstructor enum DataOnEnum {
|
||||
A("hello"),
|
||||
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()) + ")");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
import lombok.Data;
|
||||
class DataOnLocalClass1 {
|
||||
DataOnLocalClass1() {
|
||||
super();
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
@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;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") String getName() {
|
||||
return this.name;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") void setName(final String name) {
|
||||
this.name = name;
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) {
|
||||
if ((o == this))
|
||||
return true;
|
||||
if ((! (o instanceof Local)))
|
||||
return false;
|
||||
final Local other = (Local) o;
|
||||
if ((! other.canEqual((java.lang.Object) this)))
|
||||
return false;
|
||||
if ((this.getX() != other.getX()))
|
||||
return false;
|
||||
if (((this.getName() == null) ? (other.getName() != null) : (! this.getName().equals((java.lang.Object) other.getName()))))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) {
|
||||
return (other instanceof Local);
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() {
|
||||
final int PRIME = 31;
|
||||
int result = 1;
|
||||
result = ((result * PRIME) + this.getX());
|
||||
result = ((result * PRIME) + ((this.getName() == null) ? 0 : this.getName().hashCode()));
|
||||
return result;
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
|
||||
return (((("Local(x=" + this.getX()) + ", name=") + this.getName()) + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") void setName(final @lombok.NonNull String name) {
|
||||
if ((name == null))
|
||||
throw new java.lang.NullPointerException("name");
|
||||
this.name = name;
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) {
|
||||
if ((o == this))
|
||||
return true;
|
||||
if ((! (o instanceof InnerLocal)))
|
||||
return false;
|
||||
final InnerLocal other = (InnerLocal) o;
|
||||
if ((! other.canEqual((java.lang.Object) this)))
|
||||
return false;
|
||||
if (((this.getName() == null) ? (other.getName() != null) : (! this.getName().equals((java.lang.Object) other.getName()))))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) {
|
||||
return (other instanceof InnerLocal);
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() {
|
||||
final int PRIME = 31;
|
||||
int result = 1;
|
||||
result = ((result * PRIME) + ((this.getName() == null) ? 0 : this.getName().hashCode()));
|
||||
return result;
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
|
||||
return (("Local.InnerLocal(name=" + this.getName()) + ")");
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) {
|
||||
if ((o == this))
|
||||
return true;
|
||||
if ((! (o instanceof Local)))
|
||||
return false;
|
||||
final Local other = (Local) o;
|
||||
if ((! other.canEqual((java.lang.Object) this)))
|
||||
return false;
|
||||
if ((this.getX() != other.getX()))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) {
|
||||
return (other instanceof Local);
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() {
|
||||
final int PRIME = 31;
|
||||
int result = 1;
|
||||
result = ((result * PRIME) + this.getX());
|
||||
return result;
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
|
||||
return (("Local(x=" + this.getX()) + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
DataOnLocalClass2() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,208 @@
|
||||
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;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") String getName() {
|
||||
return this.name;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") void setName(final String name) {
|
||||
this.name = name;
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) {
|
||||
if ((o == this))
|
||||
return true;
|
||||
if ((! (o instanceof Data1)))
|
||||
return false;
|
||||
final Data1 other = (Data1) o;
|
||||
if ((! other.canEqual((java.lang.Object) this)))
|
||||
return false;
|
||||
if ((this.getX() != other.getX()))
|
||||
return false;
|
||||
if (((this.getName() == null) ? (other.getName() != null) : (! this.getName().equals((java.lang.Object) other.getName()))))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) {
|
||||
return (other instanceof Data1);
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() {
|
||||
final int PRIME = 31;
|
||||
int result = 1;
|
||||
result = ((result * PRIME) + this.getX());
|
||||
result = ((result * PRIME) + ((this.getName() == null) ? 0 : this.getName().hashCode()));
|
||||
return result;
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
|
||||
return (((("Data1(x=" + this.getX()) + ", name=") + this.getName()) + ")");
|
||||
}
|
||||
}
|
||||
@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;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") String getName() {
|
||||
return this.name;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") void setName(final String name) {
|
||||
this.name = name;
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) {
|
||||
if ((o == this))
|
||||
return true;
|
||||
if ((! (o instanceof Data2)))
|
||||
return false;
|
||||
final Data2 other = (Data2) o;
|
||||
if ((! other.canEqual((java.lang.Object) this)))
|
||||
return false;
|
||||
if ((this.getX() != other.getX()))
|
||||
return false;
|
||||
if (((this.getName() == null) ? (other.getName() != null) : (! this.getName().equals((java.lang.Object) other.getName()))))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) {
|
||||
return (other instanceof Data2);
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() {
|
||||
final int PRIME = 31;
|
||||
int result = 1;
|
||||
result = ((result * PRIME) + this.getX());
|
||||
result = ((result * PRIME) + ((this.getName() == null) ? 0 : this.getName().hashCode()));
|
||||
return result;
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
|
||||
return (((("Data2(x=" + this.getX()) + ", name=") + this.getName()) + ")");
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") String getName() {
|
||||
return this.name;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") void setName(final String name) {
|
||||
this.name = name;
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) {
|
||||
if ((o == this))
|
||||
return true;
|
||||
if ((! (o instanceof Data3)))
|
||||
return false;
|
||||
final Data3 other = (Data3) o;
|
||||
if ((this.getX() != other.getX()))
|
||||
return false;
|
||||
if (((this.getName() == null) ? (other.getName() != null) : (! this.getName().equals((java.lang.Object) other.getName()))))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() {
|
||||
final int PRIME = 31;
|
||||
int result = 1;
|
||||
result = ((result * PRIME) + this.getX());
|
||||
result = ((result * PRIME) + ((this.getName() == null) ? 0 : this.getName().hashCode()));
|
||||
return result;
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
|
||||
return (((("Data3(x=" + this.getX()) + ", name=") + this.getName()) + ")");
|
||||
}
|
||||
}
|
||||
final @Data @lombok.EqualsAndHashCode(callSuper = true) class Data4 extends java.util.Timer {
|
||||
final int x;
|
||||
public @java.lang.SuppressWarnings("all") int getX() {
|
||||
return this.x;
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
|
||||
return (("Data4(x=" + this.getX()) + ")");
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) {
|
||||
if ((o == this))
|
||||
return true;
|
||||
if ((! (o instanceof Data4)))
|
||||
return false;
|
||||
final Data4 other = (Data4) o;
|
||||
if ((! other.canEqual((java.lang.Object) this)))
|
||||
return false;
|
||||
if ((! super.equals(o)))
|
||||
return false;
|
||||
if ((this.getX() != other.getX()))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) {
|
||||
return (other instanceof Data4);
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() {
|
||||
final int PRIME = 31;
|
||||
int result = 1;
|
||||
result = ((result * PRIME) + super.hashCode());
|
||||
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;
|
||||
if ((! (o instanceof Data5)))
|
||||
return false;
|
||||
final Data5 other = (Data5) 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 Data5);
|
||||
}
|
||||
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 "Data5()";
|
||||
}
|
||||
}
|
||||
final @Data class Data6 {
|
||||
public @java.lang.SuppressWarnings("all") Data6() {
|
||||
super();
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) {
|
||||
if ((o == this))
|
||||
return true;
|
||||
if ((! (o instanceof Data6)))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
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 "Data6()";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
@lombok.Data @lombok.Getter class DataWithGetter {
|
||||
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;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") void setY(final int y) {
|
||||
this.y = y;
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) {
|
||||
if ((o == this))
|
||||
return true;
|
||||
if ((! (o instanceof DataWithGetter)))
|
||||
return false;
|
||||
final DataWithGetter other = (DataWithGetter) o;
|
||||
if ((! other.canEqual((java.lang.Object) this)))
|
||||
return false;
|
||||
if ((this.getX() != other.getX()))
|
||||
return false;
|
||||
if ((this.getY() != other.getY()))
|
||||
return false;
|
||||
if (((this.getZ() == null) ? (other.getZ() != null) : (! this.getZ().equals((java.lang.Object) other.getZ()))))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) {
|
||||
return (other instanceof DataWithGetter);
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() {
|
||||
final int PRIME = 31;
|
||||
int result = 1;
|
||||
result = ((result * PRIME) + this.getX());
|
||||
result = ((result * PRIME) + this.getY());
|
||||
result = ((result * PRIME) + ((this.getZ() == null) ? 0 : this.getZ().hashCode()));
|
||||
return result;
|
||||
}
|
||||
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.lang.SuppressWarnings("all") int getX() {
|
||||
return this.x;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") int getY() {
|
||||
return this.y;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") String getZ() {
|
||||
return this.z;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
@lombok.Data @lombok.Getter(lombok.AccessLevel.NONE) class DataWithGetterNone {
|
||||
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;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") void setY(final int y) {
|
||||
this.y = y;
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) {
|
||||
if ((o == this))
|
||||
return true;
|
||||
if ((! (o instanceof DataWithGetterNone)))
|
||||
return false;
|
||||
final DataWithGetterNone other = (DataWithGetterNone) o;
|
||||
if ((! other.canEqual((java.lang.Object) this)))
|
||||
return false;
|
||||
if ((this.x != other.x))
|
||||
return false;
|
||||
if ((this.y != other.y))
|
||||
return false;
|
||||
if (((this.z == null) ? (other.z != null) : (! this.z.equals((java.lang.Object) other.z))))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) {
|
||||
return (other instanceof DataWithGetterNone);
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() {
|
||||
final int PRIME = 31;
|
||||
int result = 1;
|
||||
result = ((result * PRIME) + this.x);
|
||||
result = ((result * PRIME) + this.y);
|
||||
result = ((result * PRIME) + ((this.z == null) ? 0 : this.z.hashCode()));
|
||||
return result;
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
|
||||
return (((((("DataWithGetterNone(x=" + this.x) + ", y=") + this.y) + ", z=") + this.z) + ")");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
import lombok.Delegate;
|
||||
class DelegatePlain {
|
||||
private static class FooImpl implements Foo {
|
||||
private FooImpl() {
|
||||
super();
|
||||
}
|
||||
public void foo() {
|
||||
}
|
||||
public void bar(java.util.ArrayList<java.lang.String> list) {
|
||||
}
|
||||
}
|
||||
private static class BarImpl implements Bar {
|
||||
private BarImpl() {
|
||||
super();
|
||||
}
|
||||
public void bar(java.util.ArrayList<java.lang.String> list) {
|
||||
}
|
||||
}
|
||||
private static interface Foo extends Bar {
|
||||
void foo();
|
||||
}
|
||||
private static interface Bar {
|
||||
void bar(java.util.ArrayList<java.lang.String> list);
|
||||
}
|
||||
private final @Delegate(types = Bar.class) BarImpl bar = new BarImpl();
|
||||
private final @Delegate(types = Foo.class,excludes = Bar.class) FooImpl foo = new FooImpl();
|
||||
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();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
class GetterAccessLevel {
|
||||
@lombok.Getter(lombok.AccessLevel.NONE) boolean isNone;
|
||||
@lombok.Getter(lombok.AccessLevel.PRIVATE) boolean isPrivate;
|
||||
@lombok.Getter(lombok.AccessLevel.PACKAGE) boolean isPackage;
|
||||
@lombok.Getter(lombok.AccessLevel.PROTECTED) boolean isProtected;
|
||||
@lombok.Getter(lombok.AccessLevel.PUBLIC) boolean isPublic;
|
||||
@lombok.Getter(lombok.AccessLevel.NONE) String noneString;
|
||||
@lombok.Getter(lombok.AccessLevel.PRIVATE) String privateString;
|
||||
@lombok.Getter(lombok.AccessLevel.PACKAGE) String packageString;
|
||||
@lombok.Getter(lombok.AccessLevel.PROTECTED) String protectedString;
|
||||
@lombok.Getter(lombok.AccessLevel.PUBLIC) String publicString;
|
||||
@lombok.Getter(value = lombok.AccessLevel.PUBLIC) String value;
|
||||
private @java.lang.SuppressWarnings("all") boolean isPrivate() {
|
||||
return this.isPrivate;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all") boolean isPackage() {
|
||||
return this.isPackage;
|
||||
}
|
||||
protected @java.lang.SuppressWarnings("all") boolean isProtected() {
|
||||
return this.isProtected;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") boolean isPublic() {
|
||||
return this.isPublic;
|
||||
}
|
||||
private @java.lang.SuppressWarnings("all") String getPrivateString() {
|
||||
return this.privateString;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all") String getPackageString() {
|
||||
return this.packageString;
|
||||
}
|
||||
protected @java.lang.SuppressWarnings("all") String getProtectedString() {
|
||||
return this.protectedString;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") String getPublicString() {
|
||||
return this.publicString;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") String getValue() {
|
||||
return this.value;
|
||||
}
|
||||
GetterAccessLevel() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
class Getter1 {
|
||||
@lombok.Getter boolean foo;
|
||||
public @java.lang.SuppressWarnings("all") boolean isFoo() {
|
||||
return this.foo;
|
||||
}
|
||||
Getter1() {
|
||||
super();
|
||||
}
|
||||
boolean hasFoo() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
class Getter2 {
|
||||
@lombok.Getter boolean foo;
|
||||
Getter2() {
|
||||
super();
|
||||
}
|
||||
boolean isFoo() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
class Getter3 {
|
||||
@lombok.Getter boolean foo;
|
||||
Getter3() {
|
||||
super();
|
||||
}
|
||||
boolean getFoo() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
Getter5() {
|
||||
super();
|
||||
}
|
||||
String isFoo() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
class Getter6 {
|
||||
@lombok.Getter String foo;
|
||||
Getter6() {
|
||||
super();
|
||||
}
|
||||
String getFoo() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
Getter8() {
|
||||
super();
|
||||
}
|
||||
boolean isFoo() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
class Getter9 {
|
||||
@lombok.Getter String foo;
|
||||
Getter9() {
|
||||
super();
|
||||
}
|
||||
boolean getFoo() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
class Getter10 {
|
||||
@lombok.Getter boolean foo;
|
||||
public @java.lang.SuppressWarnings("all") boolean isFoo() {
|
||||
return this.foo;
|
||||
}
|
||||
Getter10() {
|
||||
super();
|
||||
}
|
||||
static boolean hasFoo() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
class Getter11 {
|
||||
@lombok.Getter boolean foo;
|
||||
Getter11() {
|
||||
super();
|
||||
}
|
||||
static boolean isFoo() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
class Getter12 {
|
||||
@lombok.Getter boolean foo;
|
||||
Getter12() {
|
||||
super();
|
||||
}
|
||||
static boolean getFoo() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
Getter14() {
|
||||
super();
|
||||
}
|
||||
static boolean isFoo() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
class Getter15 {
|
||||
@lombok.Getter String foo;
|
||||
Getter15() {
|
||||
super();
|
||||
}
|
||||
static boolean getFoo() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
class Getter16 {
|
||||
@lombok.Getter String foo;
|
||||
public @java.lang.SuppressWarnings("all") String getFoo() {
|
||||
return this.foo;
|
||||
}
|
||||
Getter16() {
|
||||
super();
|
||||
}
|
||||
static String hasFoo() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
class Getter17 {
|
||||
@lombok.Getter String foo;
|
||||
public @java.lang.SuppressWarnings("all") String getFoo() {
|
||||
return this.foo;
|
||||
}
|
||||
Getter17() {
|
||||
super();
|
||||
}
|
||||
static String isFoo() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
class Getter18 {
|
||||
@lombok.Getter String foo;
|
||||
Getter18() {
|
||||
super();
|
||||
}
|
||||
static String getFoo() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
class Getter {
|
||||
@lombok.Getter boolean foo;
|
||||
@lombok.Getter boolean isBar;
|
||||
@lombok.Getter boolean hasBaz;
|
||||
public @java.lang.SuppressWarnings("all") boolean isFoo() {
|
||||
return this.foo;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") boolean isBar() {
|
||||
return this.isBar;
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
class YetMoreGetter {
|
||||
@lombok.Getter boolean foo;
|
||||
YetMoreGetter() {
|
||||
super();
|
||||
}
|
||||
boolean getFoo() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
class GetterLazy {
|
||||
static class ValueType {
|
||||
ValueType() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
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>>();
|
||||
public @java.lang.SuppressWarnings("all") ValueType getFieldName() {
|
||||
java.util.concurrent.atomic.AtomicReference<ValueType> value = this.fieldName.get();
|
||||
if ((value == null))
|
||||
{
|
||||
synchronized (this.fieldName)
|
||||
{
|
||||
value = this.fieldName.get();
|
||||
if ((value == null))
|
||||
{
|
||||
value = new java.util.concurrent.atomic.AtomicReference<ValueType>(new ValueType());
|
||||
this.fieldName.set(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return value.get();
|
||||
}
|
||||
GetterLazy() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
@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 = "";
|
||||
public @java.lang.SuppressWarnings("all") String getValue() {
|
||||
java.util.concurrent.atomic.AtomicReference<String> value = this.value.get();
|
||||
if ((value == null))
|
||||
{
|
||||
synchronized (this.value)
|
||||
{
|
||||
value = this.value.get();
|
||||
if ((value == null))
|
||||
{
|
||||
value = new java.util.concurrent.atomic.AtomicReference<String>("");
|
||||
this.value.set(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return value.get();
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") String getValue2() {
|
||||
return this.value2;
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) {
|
||||
if ((o == this))
|
||||
return true;
|
||||
if ((! (o instanceof GetterLazyEahcToString)))
|
||||
return false;
|
||||
final GetterLazyEahcToString other = (GetterLazyEahcToString) o;
|
||||
if ((! other.canEqual((java.lang.Object) this)))
|
||||
return false;
|
||||
if (((this.getValue() == null) ? (other.getValue() != null) : (! this.getValue().equals((java.lang.Object) other.getValue()))))
|
||||
return false;
|
||||
if (((this.value2 == null) ? (other.value2 != null) : (! this.value2.equals((java.lang.Object) other.value2))))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) {
|
||||
return (other instanceof GetterLazyEahcToString);
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() {
|
||||
final int PRIME = 31;
|
||||
int result = 1;
|
||||
result = ((result * PRIME) + ((this.getValue() == null) ? 0 : this.getValue().hashCode()));
|
||||
result = ((result * PRIME) + ((this.value2 == null) ? 0 : this.value2.hashCode()));
|
||||
return result;
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
|
||||
return (((("GetterLazyEahcToString(value=" + this.getValue()) + ", value2=") + this.value2) + ")");
|
||||
}
|
||||
GetterLazyEahcToString() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
class GetterLazyInvalidNotFinal {
|
||||
private @lombok.Getter(lazy = true) String fieldName = "";
|
||||
GetterLazyInvalidNotFinal() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
class GetterLazyInvalidNotPrivate {
|
||||
final @lombok.Getter(lazy = true) String fieldName = "";
|
||||
GetterLazyInvalidNotPrivate() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
class GetterLazyInvalidNotPrivateFinal {
|
||||
@lombok.Getter(lazy = true) String fieldName = "";
|
||||
GetterLazyInvalidNotPrivateFinal() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
class GetterLazyInvalidNone {
|
||||
private final @lombok.Getter(lazy = true,value = lombok.AccessLevel.NONE) String fieldName = "";
|
||||
GetterLazyInvalidNone() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@lombok.Getter(lazy = true) class GetterLazyInvalidClass {
|
||||
private final String fieldName = "";
|
||||
public @java.lang.SuppressWarnings("all") String getFieldName() {
|
||||
return this.fieldName;
|
||||
}
|
||||
GetterLazyInvalidClass() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
class GetterLazyInvalidNoInit {
|
||||
private final @lombok.Getter(lazy = true) String fieldName;
|
||||
GetterLazyInvalidNoInit() {
|
||||
super();
|
||||
this.fieldName = "foo";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
class GetterLazyNative {
|
||||
private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Boolean>> booleanField = 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.Byte>> byteField = new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Byte>>();
|
||||
private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Short>> shortField = new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Short>>();
|
||||
private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Integer>> intField = new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Integer>>();
|
||||
private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Long>> longField = new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Long>>();
|
||||
private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Float>> floatField = new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Float>>();
|
||||
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[]>>();
|
||||
public @java.lang.SuppressWarnings("all") boolean isBooleanField() {
|
||||
java.util.concurrent.atomic.AtomicReference<java.lang.Boolean> value = this.booleanField.get();
|
||||
if ((value == null))
|
||||
{
|
||||
synchronized (this.booleanField)
|
||||
{
|
||||
value = this.booleanField.get();
|
||||
if ((value == null))
|
||||
{
|
||||
value = new java.util.concurrent.atomic.AtomicReference<java.lang.Boolean>(true);
|
||||
this.booleanField.set(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return value.get();
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") byte getByteField() {
|
||||
java.util.concurrent.atomic.AtomicReference<java.lang.Byte> value = this.byteField.get();
|
||||
if ((value == null))
|
||||
{
|
||||
synchronized (this.byteField)
|
||||
{
|
||||
value = this.byteField.get();
|
||||
if ((value == null))
|
||||
{
|
||||
value = new java.util.concurrent.atomic.AtomicReference<java.lang.Byte>(1);
|
||||
this.byteField.set(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return value.get();
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") short getShortField() {
|
||||
java.util.concurrent.atomic.AtomicReference<java.lang.Short> value = this.shortField.get();
|
||||
if ((value == null))
|
||||
{
|
||||
synchronized (this.shortField)
|
||||
{
|
||||
value = this.shortField.get();
|
||||
if ((value == null))
|
||||
{
|
||||
value = new java.util.concurrent.atomic.AtomicReference<java.lang.Short>(1);
|
||||
this.shortField.set(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return value.get();
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") int getIntField() {
|
||||
java.util.concurrent.atomic.AtomicReference<java.lang.Integer> value = this.intField.get();
|
||||
if ((value == null))
|
||||
{
|
||||
synchronized (this.intField)
|
||||
{
|
||||
value = this.intField.get();
|
||||
if ((value == null))
|
||||
{
|
||||
value = new java.util.concurrent.atomic.AtomicReference<java.lang.Integer>(1);
|
||||
this.intField.set(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return value.get();
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") long getLongField() {
|
||||
java.util.concurrent.atomic.AtomicReference<java.lang.Long> value = this.longField.get();
|
||||
if ((value == null))
|
||||
{
|
||||
synchronized (this.longField)
|
||||
{
|
||||
value = this.longField.get();
|
||||
if ((value == null))
|
||||
{
|
||||
value = new java.util.concurrent.atomic.AtomicReference<java.lang.Long>(1);
|
||||
this.longField.set(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return value.get();
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") float getFloatField() {
|
||||
java.util.concurrent.atomic.AtomicReference<java.lang.Float> value = this.floatField.get();
|
||||
if ((value == null))
|
||||
{
|
||||
synchronized (this.floatField)
|
||||
{
|
||||
value = this.floatField.get();
|
||||
if ((value == null))
|
||||
{
|
||||
value = new java.util.concurrent.atomic.AtomicReference<java.lang.Float>(1.0f);
|
||||
this.floatField.set(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return value.get();
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") double getDoubleField() {
|
||||
java.util.concurrent.atomic.AtomicReference<java.lang.Double> value = this.doubleField.get();
|
||||
if ((value == null))
|
||||
{
|
||||
synchronized (this.doubleField)
|
||||
{
|
||||
value = this.doubleField.get();
|
||||
if ((value == null))
|
||||
{
|
||||
value = new java.util.concurrent.atomic.AtomicReference<java.lang.Double>(1.0);
|
||||
this.doubleField.set(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return value.get();
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") char getCharField() {
|
||||
java.util.concurrent.atomic.AtomicReference<java.lang.Character> value = this.charField.get();
|
||||
if ((value == null))
|
||||
{
|
||||
synchronized (this.charField)
|
||||
{
|
||||
value = this.charField.get();
|
||||
if ((value == null))
|
||||
{
|
||||
value = new java.util.concurrent.atomic.AtomicReference<java.lang.Character>('1');
|
||||
this.charField.set(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return value.get();
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") int[] getIntArrayField() {
|
||||
java.util.concurrent.atomic.AtomicReference<int[]> value = this.intArrayField.get();
|
||||
if ((value == null))
|
||||
{
|
||||
synchronized (this.intArrayField)
|
||||
{
|
||||
value = this.intArrayField.get();
|
||||
if ((value == null))
|
||||
{
|
||||
value = new java.util.concurrent.atomic.AtomicReference<int[]>(new int[]{1});
|
||||
this.intArrayField.set(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return value.get();
|
||||
}
|
||||
GetterLazyNative() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
@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();
|
||||
}
|
||||
|
||||
}
|
||||
@lombok.Getter(lombok.AccessLevel.PROTECTED) class GetterOnClass2 {
|
||||
@lombok.Getter(lombok.AccessLevel.NONE) boolean isNone;
|
||||
boolean isProtected;
|
||||
@lombok.Getter(lombok.AccessLevel.PACKAGE) boolean isPackage;
|
||||
@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();
|
||||
}
|
||||
}
|
||||
@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();
|
||||
}
|
||||
}
|
||||
@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();
|
||||
}
|
||||
}
|
||||
@lombok.Getter class GetterOnClass6 {
|
||||
String couldBeNull;
|
||||
@lombok.NonNull String nonNull;
|
||||
public @java.lang.SuppressWarnings("all") String getCouldBeNull() {
|
||||
return this.couldBeNull;
|
||||
}
|
||||
public @lombok.NonNull @java.lang.SuppressWarnings("all") String getNonNull() {
|
||||
return this.nonNull;
|
||||
}
|
||||
GetterOnClass6() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
import lombok.Getter;
|
||||
class GetterOnMethod {
|
||||
@lombok.Getter() int i;
|
||||
@lombok.Getter() int j;
|
||||
public @Deprecated @java.lang.SuppressWarnings("all") int getI() {
|
||||
return this.i;
|
||||
}
|
||||
public @java.lang.Deprecated @java.lang.SuppressWarnings("all") int getJ() {
|
||||
return this.j;
|
||||
}
|
||||
GetterOnMethod() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@lombok.Getter() class GetterOnClassOnMethod {
|
||||
int i;
|
||||
int j;
|
||||
public @java.lang.SuppressWarnings("all") int getI() {
|
||||
return this.i;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") int getJ() {
|
||||
return this.j;
|
||||
}
|
||||
GetterOnClassOnMethod() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@lombok.Getter() class GetterOnClassAndOnAField {
|
||||
int i;
|
||||
@lombok.Getter() int j;
|
||||
public @java.lang.Deprecated @java.lang.SuppressWarnings("all") int getJ() {
|
||||
return this.j;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") int getI() {
|
||||
return this.i;
|
||||
}
|
||||
GetterOnClassAndOnAField() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
class Getter {
|
||||
static @lombok.Getter boolean foo;
|
||||
static @lombok.Getter int bar;
|
||||
<clinit>() {
|
||||
}
|
||||
public static @java.lang.SuppressWarnings("all") boolean isFoo() {
|
||||
return Getter.foo;
|
||||
}
|
||||
public static @java.lang.SuppressWarnings("all") int getBar() {
|
||||
return Getter.bar;
|
||||
}
|
||||
Getter() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import lombok.Getter;
|
||||
class GetterPlain {
|
||||
@lombok.Getter int i;
|
||||
@Getter int foo;
|
||||
public @java.lang.SuppressWarnings("all") int getI() {
|
||||
return this.i;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") int getFoo() {
|
||||
return this.foo;
|
||||
}
|
||||
GetterPlain() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
class GetterWithDollar1 {
|
||||
@lombok.Getter int $i;
|
||||
public @java.lang.SuppressWarnings("all") int get$i() {
|
||||
return this.$i;
|
||||
}
|
||||
GetterWithDollar1() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
class GetterWithDollar2 {
|
||||
@lombok.Getter int $i;
|
||||
@lombok.Getter int i;
|
||||
public @java.lang.SuppressWarnings("all") int get$i() {
|
||||
return this.$i;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") int getI() {
|
||||
return this.i;
|
||||
}
|
||||
GetterWithDollar2() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import lombok.extern.apachecommons.CommonsLog;
|
||||
@lombok.extern.apachecommons.CommonsLog class LoggerCommons {
|
||||
private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(LoggerCommons.class);
|
||||
<clinit>() {
|
||||
}
|
||||
LoggerCommons() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@CommonsLog class LoggerCommonsWithImport {
|
||||
private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(LoggerCommonsWithImport.class);
|
||||
<clinit>() {
|
||||
}
|
||||
LoggerCommonsWithImport() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import lombok.extern.java.Log;
|
||||
@lombok.extern.java.Log class LoggerJul {
|
||||
private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(LoggerJul.class.getName());
|
||||
<clinit>() {
|
||||
}
|
||||
LoggerJul() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@Log class LoggerJulWithImport {
|
||||
private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(LoggerJulWithImport.class.getName());
|
||||
<clinit>() {
|
||||
}
|
||||
LoggerJulWithImport() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import lombok.extern.log4j.Log4j;
|
||||
@lombok.extern.log4j.Log4j class LoggerLog4j {
|
||||
private static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(LoggerLog4j.class);
|
||||
<clinit>() {
|
||||
}
|
||||
LoggerLog4j() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@Log4j class LoggerLog4jWithImport {
|
||||
private static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(LoggerLog4jWithImport.class);
|
||||
<clinit>() {
|
||||
}
|
||||
LoggerLog4jWithImport() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@lombok.extern.slf4j.Slf4j class LoggerSlf4j {
|
||||
private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(LoggerSlf4j.class);
|
||||
<clinit>() {
|
||||
}
|
||||
LoggerSlf4j() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@Slf4j class LoggerSlf4jWithImport {
|
||||
private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(LoggerSlf4jWithImport.class);
|
||||
<clinit>() {
|
||||
}
|
||||
LoggerSlf4jWithImport() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
class LoggerSlf4jOuter {
|
||||
static @lombok.extern.slf4j.Slf4j class Inner {
|
||||
private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(Inner.class);
|
||||
<clinit>() {
|
||||
}
|
||||
Inner() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
LoggerSlf4jOuter() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
@lombok.extern.slf4j.Slf4j class LoggerSlf4jAlreadyExists {
|
||||
int log;
|
||||
LoggerSlf4jAlreadyExists() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
class LoggerSlf4jOnNonType {
|
||||
LoggerSlf4jOnNonType() {
|
||||
super();
|
||||
}
|
||||
@lombok.extern.slf4j.Slf4j void foo() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
@lombok.extern.slf4j.Slf4j interface LoggerSlf4jTypesInterface {
|
||||
}
|
||||
@lombok.extern.slf4j.Slf4j @interface LoggerSlf4jTypesAnnotation {
|
||||
}
|
||||
@lombok.extern.slf4j.Slf4j enum LoggerSlf4jTypesEnum {
|
||||
private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(LoggerSlf4jTypesEnum.class);
|
||||
<clinit>() {
|
||||
}
|
||||
LoggerSlf4jTypesEnum() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@lombok.extern.slf4j.Slf4j enum LoggerSlf4jTypesEnumWithElement {
|
||||
FOO(),
|
||||
private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(LoggerSlf4jTypesEnumWithElement.class);
|
||||
<clinit>() {
|
||||
}
|
||||
LoggerSlf4jTypesEnumWithElement() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
interface LoggerSlf4jTypesInterfaceOuter {
|
||||
@lombok.extern.slf4j.Slf4j class Inner {
|
||||
private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(Inner.class);
|
||||
<clinit>() {
|
||||
}
|
||||
Inner() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
//ignore
|
||||
@@ -0,0 +1,28 @@
|
||||
import lombok.Getter;
|
||||
import lombok.AccessLevel;
|
||||
class MultiFieldGetter {
|
||||
@Getter(AccessLevel.PROTECTED) int x;
|
||||
@Getter(AccessLevel.PROTECTED) int y;
|
||||
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;
|
||||
@java.lang.SuppressWarnings("all") int getX() {
|
||||
return this.x;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all") int getY() {
|
||||
return this.y;
|
||||
}
|
||||
MultiFieldGetter2() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
class NonNullPlain {
|
||||
@lombok.Setter @lombok.NonNull @lombok.Getter int i;
|
||||
@lombok.Getter @lombok.Setter @lombok.NonNull String s;
|
||||
public @java.lang.SuppressWarnings("all") void setI(final @lombok.NonNull int i) {
|
||||
this.i = i;
|
||||
}
|
||||
public @lombok.NonNull @java.lang.SuppressWarnings("all") int getI() {
|
||||
return this.i;
|
||||
}
|
||||
public @lombok.NonNull @java.lang.SuppressWarnings("all") String getS() {
|
||||
return this.s;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") void setS(final @lombok.NonNull String s) {
|
||||
if ((s == null))
|
||||
throw new java.lang.NullPointerException("s");
|
||||
this.s = s;
|
||||
}
|
||||
NonNullPlain() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
class SetterAccessLevel {
|
||||
@lombok.Setter(lombok.AccessLevel.NONE) boolean isNone;
|
||||
@lombok.Setter(lombok.AccessLevel.PRIVATE) boolean isPrivate;
|
||||
@lombok.Setter(lombok.AccessLevel.PACKAGE) boolean isPackage;
|
||||
@lombok.Setter(lombok.AccessLevel.PROTECTED) boolean isProtected;
|
||||
@lombok.Setter(lombok.AccessLevel.PUBLIC) boolean isPublic;
|
||||
@lombok.Setter(value = lombok.AccessLevel.PUBLIC) boolean value;
|
||||
private @java.lang.SuppressWarnings("all") void setPrivate(final boolean isPrivate) {
|
||||
this.isPrivate = isPrivate;
|
||||
}
|
||||
@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;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") void setPublic(final boolean isPublic) {
|
||||
this.isPublic = isPublic;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") void setValue(final boolean value) {
|
||||
this.value = value;
|
||||
}
|
||||
SetterAccessLevel() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
class Setter1 {
|
||||
@lombok.Setter boolean foo;
|
||||
Setter1() {
|
||||
super();
|
||||
}
|
||||
void setFoo(boolean foo) {
|
||||
}
|
||||
}
|
||||
class Setter2 {
|
||||
@lombok.Setter boolean foo;
|
||||
Setter2() {
|
||||
super();
|
||||
}
|
||||
void setFoo(String foo) {
|
||||
}
|
||||
}
|
||||
class Setter3 {
|
||||
@lombok.Setter String foo;
|
||||
Setter3() {
|
||||
super();
|
||||
}
|
||||
void setFoo(boolean foo) {
|
||||
}
|
||||
}
|
||||
class Setter4 {
|
||||
@lombok.Setter String foo;
|
||||
Setter4() {
|
||||
super();
|
||||
}
|
||||
void setFoo(String foo) {
|
||||
}
|
||||
}
|
||||
class Setter5 {
|
||||
@lombok.Setter String foo;
|
||||
Setter5() {
|
||||
super();
|
||||
}
|
||||
void setFoo() {
|
||||
}
|
||||
}
|
||||
class Setter6 {
|
||||
@lombok.Setter String foo;
|
||||
Setter6() {
|
||||
super();
|
||||
}
|
||||
void setFoo(String foo, int x) {
|
||||
}
|
||||
}
|
||||
class Setter7 {
|
||||
@lombok.Setter String foo;
|
||||
Setter7() {
|
||||
super();
|
||||
}
|
||||
static void setFoo() {
|
||||
}
|
||||
}
|
||||
class Setter8 {
|
||||
@lombok.Setter boolean isFoo;
|
||||
Setter8() {
|
||||
super();
|
||||
}
|
||||
void setIsFoo() {
|
||||
}
|
||||
}
|
||||
class Setter9 {
|
||||
@lombok.Setter boolean isFoo;
|
||||
Setter9() {
|
||||
super();
|
||||
}
|
||||
void setFoo() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
@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();
|
||||
}
|
||||
}
|
||||
@lombok.Setter(lombok.AccessLevel.PROTECTED) class SetterOnClass2 {
|
||||
@lombok.Setter(lombok.AccessLevel.NONE) boolean isNone;
|
||||
boolean isProtected;
|
||||
@lombok.Setter(lombok.AccessLevel.PACKAGE) boolean isPackage;
|
||||
@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();
|
||||
}
|
||||
}
|
||||
@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();
|
||||
}
|
||||
}
|
||||
@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();
|
||||
}
|
||||
}
|
||||
@lombok.Setter class SetterOnClass6 {
|
||||
String couldBeNull;
|
||||
@lombok.NonNull String nonNull;
|
||||
public @java.lang.SuppressWarnings("all") void setCouldBeNull(final String couldBeNull) {
|
||||
this.couldBeNull = couldBeNull;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") void setNonNull(final @lombok.NonNull String nonNull) {
|
||||
if ((nonNull == null))
|
||||
throw new java.lang.NullPointerException("nonNull");
|
||||
this.nonNull = nonNull;
|
||||
}
|
||||
SetterOnClass6() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
import lombok.Setter;
|
||||
class SetterOnMethod {
|
||||
@lombok.Setter() int i;
|
||||
@lombok.Setter() int j;
|
||||
public @Deprecated @java.lang.SuppressWarnings("all") void setI(final int i) {
|
||||
this.i = i;
|
||||
}
|
||||
public @java.lang.Deprecated @java.lang.SuppressWarnings("all") void setJ(final int j) {
|
||||
this.j = j;
|
||||
}
|
||||
SetterOnMethod() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@lombok.Setter() class SetterOnClassOnMethod {
|
||||
int i;
|
||||
int j;
|
||||
public @java.lang.SuppressWarnings("all") void setI(final int i) {
|
||||
this.i = i;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") void setJ(final int j) {
|
||||
this.j = j;
|
||||
}
|
||||
SetterOnClassOnMethod() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@lombok.Setter() class SetterOnClassAndOnAField {
|
||||
int i;
|
||||
@lombok.Setter() int j;
|
||||
public @java.lang.Deprecated @java.lang.SuppressWarnings("all") void setJ(final int j) {
|
||||
this.j = j;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") void setI(final int i) {
|
||||
this.i = i;
|
||||
}
|
||||
SetterOnClassAndOnAField() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
import lombok.Setter;
|
||||
class SetterOnParam {
|
||||
@lombok.Setter() int i;
|
||||
@lombok.Setter() int j;
|
||||
public @java.lang.SuppressWarnings("all") void setI(final @SuppressWarnings("all") int i) {
|
||||
this.i = i;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") void setJ(final @java.lang.SuppressWarnings("all") int j) {
|
||||
this.j = j;
|
||||
}
|
||||
SetterOnParam() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@lombok.Setter() class SetterOnClassOnParam {
|
||||
int i;
|
||||
int j;
|
||||
public @java.lang.SuppressWarnings("all") void setI(final int i) {
|
||||
this.i = i;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") void setJ(final int j) {
|
||||
this.j = j;
|
||||
}
|
||||
SetterOnClassOnParam() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@lombok.Setter() class SetterOnClassAndOnAFieldParam {
|
||||
int i;
|
||||
@lombok.Setter() int j;
|
||||
public @java.lang.SuppressWarnings("all") void setJ(final @java.lang.SuppressWarnings("all") int j) {
|
||||
this.j = j;
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") void setI(final int i) {
|
||||
this.i = i;
|
||||
}
|
||||
SetterOnClassAndOnAFieldParam() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class SetterOnParamAndOnMethod {
|
||||
@lombok.Setter() int i;
|
||||
public @Deprecated @java.lang.SuppressWarnings("all") void setI(final @SuppressWarnings("all") int i) {
|
||||
this.i = i;
|
||||
}
|
||||
SetterOnParamAndOnMethod() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
class Setter {
|
||||
static @lombok.Setter boolean foo;
|
||||
static @lombok.Setter int bar;
|
||||
<clinit>() {
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import lombok.Setter;
|
||||
class SetterPlain {
|
||||
@lombok.Setter int i;
|
||||
@Setter int foo;
|
||||
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();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
class SetterWithDollar1 {
|
||||
@lombok.Setter int $i;
|
||||
public @java.lang.SuppressWarnings("all") void set$i(final int $i) {
|
||||
this.$i = $i;
|
||||
}
|
||||
SetterWithDollar1() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
class SetterWithDollar2 {
|
||||
@lombok.Setter int $i;
|
||||
@lombok.Setter int i;
|
||||
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();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
import java.awt.AWTException;
|
||||
import java.io.IOException;
|
||||
import java.util.Random;
|
||||
class SneakyThrowsMultiple {
|
||||
SneakyThrowsMultiple() {
|
||||
super();
|
||||
}
|
||||
public @lombok.SneakyThrows({IOException.class, Throwable.class}) void test() {
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
System.out.println("test1");
|
||||
throw new IOException();
|
||||
}
|
||||
catch (final IOException $ex) {
|
||||
throw lombok.Lombok.sneakyThrow($ex);
|
||||
}
|
||||
}
|
||||
catch (final Throwable $ex) {
|
||||
throw lombok.Lombok.sneakyThrow($ex);
|
||||
}
|
||||
}
|
||||
public @lombok.SneakyThrows({AWTException.class, IOException.class}) void test2() {
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
System.out.println("test2");
|
||||
if (new Random().nextBoolean())
|
||||
{
|
||||
throw new IOException();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new AWTException("WHAT");
|
||||
}
|
||||
}
|
||||
catch (final AWTException $ex) {
|
||||
throw lombok.Lombok.sneakyThrow($ex);
|
||||
}
|
||||
}
|
||||
catch (final IOException $ex) {
|
||||
throw lombok.Lombok.sneakyThrow($ex);
|
||||
}
|
||||
}
|
||||
public @lombok.SneakyThrows(value = {IOException.class, Throwable.class}) void test3() {
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
System.out.println("test3");
|
||||
throw new IOException();
|
||||
}
|
||||
catch (final IOException $ex) {
|
||||
throw lombok.Lombok.sneakyThrow($ex);
|
||||
}
|
||||
}
|
||||
catch (final Throwable $ex) {
|
||||
throw lombok.Lombok.sneakyThrow($ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import lombok.SneakyThrows;
|
||||
class SneakyThrowsPlain {
|
||||
SneakyThrowsPlain() {
|
||||
super();
|
||||
}
|
||||
public @lombok.SneakyThrows void test() {
|
||||
try
|
||||
{
|
||||
System.out.println("test1");
|
||||
}
|
||||
catch (final java.lang.Throwable $ex) {
|
||||
throw lombok.Lombok.sneakyThrow($ex);
|
||||
}
|
||||
}
|
||||
public @SneakyThrows void test2() {
|
||||
try
|
||||
{
|
||||
System.out.println("test2");
|
||||
}
|
||||
catch (final java.lang.Throwable $ex) {
|
||||
throw lombok.Lombok.sneakyThrow($ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import java.io.IOException;
|
||||
class SneakyThrowsSingle {
|
||||
SneakyThrowsSingle() {
|
||||
super();
|
||||
}
|
||||
public @lombok.SneakyThrows(Throwable.class) void test() {
|
||||
try
|
||||
{
|
||||
System.out.println("test1");
|
||||
}
|
||||
catch (final Throwable $ex) {
|
||||
throw lombok.Lombok.sneakyThrow($ex);
|
||||
}
|
||||
}
|
||||
public @lombok.SneakyThrows(IOException.class) void test2() {
|
||||
try
|
||||
{
|
||||
System.out.println("test2");
|
||||
throw new IOException();
|
||||
}
|
||||
catch (final IOException $ex) {
|
||||
throw lombok.Lombok.sneakyThrow($ex);
|
||||
}
|
||||
}
|
||||
public @lombok.SneakyThrows(value = IOException.class) void test3() {
|
||||
try
|
||||
{
|
||||
System.out.println("test3");
|
||||
throw new IOException();
|
||||
}
|
||||
catch (final IOException $ex) {
|
||||
throw lombok.Lombok.sneakyThrow($ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
class SynchronizedName {
|
||||
private Object read = new Object();
|
||||
private static Object READ = new Object();
|
||||
<clinit>() {
|
||||
}
|
||||
SynchronizedName() {
|
||||
super();
|
||||
}
|
||||
@lombok.Synchronized("read") void test1() {
|
||||
synchronized (this.read)
|
||||
{
|
||||
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)
|
||||
{
|
||||
System.out.println("four");
|
||||
}
|
||||
}
|
||||
@lombok.Synchronized(value = "read") void test5() {
|
||||
synchronized (this.read)
|
||||
{
|
||||
System.out.println("five");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import lombok.Synchronized;
|
||||
class SynchronizedPlain1 {
|
||||
private final @java.lang.SuppressWarnings("all") java.lang.Object $lock = new java.lang.Object[0];
|
||||
SynchronizedPlain1() {
|
||||
super();
|
||||
}
|
||||
@lombok.Synchronized void test() {
|
||||
synchronized (this.$lock)
|
||||
{
|
||||
System.out.println("one");
|
||||
}
|
||||
}
|
||||
@Synchronized void test2() {
|
||||
synchronized (this.$lock)
|
||||
{
|
||||
System.out.println("two");
|
||||
}
|
||||
}
|
||||
}
|
||||
class SynchronizedPlain2 {
|
||||
private static final @java.lang.SuppressWarnings("all") java.lang.Object $LOCK = new java.lang.Object[0];
|
||||
<clinit>() {
|
||||
}
|
||||
SynchronizedPlain2() {
|
||||
super();
|
||||
}
|
||||
static @lombok.Synchronized void test() {
|
||||
synchronized (SynchronizedPlain2.$LOCK)
|
||||
{
|
||||
System.out.println("three");
|
||||
}
|
||||
}
|
||||
static @Synchronized void test2() {
|
||||
synchronized (SynchronizedPlain2.$LOCK)
|
||||
{
|
||||
System.out.println("four");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
import lombok.ToString;
|
||||
@ToString class ToStringOuter {
|
||||
@ToString class ToStringInner {
|
||||
final int y;
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
|
||||
return (("ToStringOuter.ToStringInner(y=" + this.y) + ")");
|
||||
}
|
||||
ToStringInner() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
static @ToString class ToStringStaticInner {
|
||||
final int y;
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
|
||||
return (("ToStringOuter.ToStringStaticInner(y=" + this.y) + ")");
|
||||
}
|
||||
ToStringStaticInner() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
class ToStringMiddle {
|
||||
@ToString class ToStringMoreInner {
|
||||
final String name;
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
|
||||
return (("ToStringOuter.ToStringMiddle.ToStringMoreInner(name=" + this.name) + ")");
|
||||
}
|
||||
ToStringMoreInner() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
ToStringMiddle() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
final 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();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import lombok.ToString;
|
||||
@lombok.ToString class ToString1 {
|
||||
final 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();
|
||||
}
|
||||
}
|
||||
@ToString class ToString2 {
|
||||
final 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();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
//ignore
|
||||
@@ -0,0 +1 @@
|
||||
//ignore
|
||||
@@ -0,0 +1 @@
|
||||
//ignore
|
||||
@@ -0,0 +1 @@
|
||||
//ignore
|
||||
@@ -0,0 +1 @@
|
||||
//ignore
|
||||
@@ -0,0 +1 @@
|
||||
//ignore
|
||||
@@ -0,0 +1,8 @@
|
||||
8 warning Not generating isFoo(): A method with that name already exists
|
||||
14 warning Not generating isFoo(): A method with that name already exists (getFoo)
|
||||
32 warning Not generating getFoo(): A method with that name already exists
|
||||
50 warning Not generating getFoo(): A method with that name already exists
|
||||
62 warning Not generating isFoo(): A method with that name already exists
|
||||
68 warning Not generating isFoo(): A method with that name already exists (getFoo)
|
||||
86 warning Not generating getFoo(): A method with that name already exists
|
||||
104 warning Not generating getFoo(): A method with that name already exists
|
||||
@@ -0,0 +1 @@
|
||||
13 warning Not generating isFoo(): A method with that name already exists (getFoo)
|
||||
@@ -0,0 +1,6 @@
|
||||
2 error 'lazy' requires the field to be private and final.
|
||||
6 error 'lazy' requires the field to be private and final.
|
||||
10 error 'lazy' requires the field to be private and final.
|
||||
14 warning 'lazy' does not work with AccessLevel.NONE.
|
||||
17 error 'lazy' is not supported for @Getter on a type.
|
||||
22 error 'lazy' requires field initialization.
|
||||
@@ -0,0 +1,2 @@
|
||||
6 error 'onMethod' is not supported for @Getter on a type.
|
||||
11 error 'onMethod' is not supported for @Getter on a type.
|
||||
@@ -0,0 +1 @@
|
||||
1 warning Field 'log' already exists.
|
||||
+1
@@ -0,0 +1 @@
|
||||
2:9 ERROR @Log is not legal on non-static inner classes.
|
||||
@@ -0,0 +1 @@
|
||||
2 error @Log is legal only on types.
|
||||
@@ -0,0 +1,2 @@
|
||||
1 error @Log is legal only on classes and enums.
|
||||
4 error @Log is legal only on classes and enums.
|
||||
@@ -0,0 +1,9 @@
|
||||
2 warning Not generating setFoo(): A method with that name already exists
|
||||
7 warning Not generating setFoo(): A method with that name already exists
|
||||
12 warning Not generating setFoo(): A method with that name already exists
|
||||
17 warning Not generating setFoo(): A method with that name already exists
|
||||
22 warning Not generating setFoo(): A method with that name already exists
|
||||
27 warning Not generating setFoo(): A method with that name already exists
|
||||
32 warning Not generating setFoo(): A method with that name already exists
|
||||
37 warning Not generating setFoo(): A method with that name already exists (setIsFoo)
|
||||
42 warning Not generating setFoo(): A method with that name already exists
|
||||
@@ -0,0 +1,2 @@
|
||||
6 error 'onMethod' is not supported for @Setter on a type.
|
||||
11 error 'onMethod' is not supported for @Setter on a type.
|
||||
@@ -0,0 +1,2 @@
|
||||
6 error 'onParam' is not supported for @Setter on a type.
|
||||
11 error 'onParam' is not supported for @Setter on a type.
|
||||
@@ -0,0 +1 @@
|
||||
8 error The field write does not exist.
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright © 2011 Reinier Zwitserloot and Roel Spilker.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
package lombok.transform;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import lombok.DirectoryRunner;
|
||||
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
// For now you need to add the following vm-parameter to run the test:
|
||||
// -javaagent:${project_loc:lombok}/dist/lombok.jar
|
||||
|
||||
@RunWith(DirectoryRunner.class)
|
||||
public class TestWithEclipse implements DirectoryRunner.TestParams {
|
||||
@Override
|
||||
public DirectoryRunner.Compiler getCompiler() {
|
||||
return DirectoryRunner.Compiler.ECLIPSE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean printErrors() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public File getBeforeDirectory() {
|
||||
return new File("test/transform/resource/before");
|
||||
}
|
||||
|
||||
@Override
|
||||
public File getAfterDirectory() {
|
||||
return new File("test/transform/resource/after-eclipse");
|
||||
}
|
||||
|
||||
@Override
|
||||
public File getMessagesDirectory() {
|
||||
return new File("test/transform/resource/messages-eclipse");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user