mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-11 03:13:38 +00:00
[old-cruft] Removed old lombok.Delegate (it's in experimental now) and lombok.experimental.Wither (it's in main now).
This commit is contained in:
14 files changed
+23
-178
No files matched your search
@@ -4,6 +4,7 @@ Lombok Changelog
|
||||
### v1.18.47 "Edgy Guinea Pig"
|
||||
* BUGFIX: `@SneakyThrows` usage on JDK26 no longer results in class files that require `lombok.jar` to be on the runtime classpath (which should not be neccessary). [#4040](https://github.com/projectlombok/lombok/issues/4022).
|
||||
* PROMOTION: `@SuperBuilder` has been promoted to the main package. Otherwise, no changes have been made to the annotation. The old experimental annotation will remain for a few versions, at which point it will be marked as a deprecated annotation. Eventually it'll be removed. If you had `lombok.config` configuration for this annotation, the configuration keys for this feature have been renamed.
|
||||
* OLD-CRUFT: `lombok.experimental.Wither` and `lombok.Delegate` are deprecated remnants; these features were moved (to respectively `lombok.With` and `lombok.experimental.Delegate` over 5 years ago. They are now removed entirely. If your project is dependent on an older version of lombok which still has those; fret not, lombok still processes these annotations. It just no longer includes them in the jar.
|
||||
|
||||
### v1.18.46 (April 22nd, 2026)
|
||||
* PLATFORM: JDK26 support added [#4019](https://github.com/projectlombok/lombok/issues/4019).
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2017 The Project Lombok Authors.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* 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.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link lombok.experimental.Delegate} instead.
|
||||
*/
|
||||
@Target({ElementType.FIELD, ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@Deprecated
|
||||
public @interface Delegate {
|
||||
/**
|
||||
* Normally the type of the field is used as delegate type. However, to choose a different type to delegate, you can list one (or more) types here. Note that types with
|
||||
* type arguments can only be done as a field type. A solution for this is to create a private inner interface/class with the appropriate types extended, and possibly
|
||||
* with all methods you'd like to delegate listed, and then supply that class here. The field does not actually have to implement the type you're delegating; the
|
||||
* type listed here is used only to determine which delegate methods to generate.
|
||||
*
|
||||
* NB: All methods in {@code Object}, as well as {@code canEqual(Object other)} will never be delegated.
|
||||
*
|
||||
* @return For each method (not already in {@code java.lang.Object}) in these types, generate a delegate method.
|
||||
*/
|
||||
Class<?>[] types() default {};
|
||||
|
||||
/**
|
||||
* Each method in any of the types listed here (include supertypes) will <em>not</em> be delegated.
|
||||
*
|
||||
* NB: All methods in {@code Object}, as well as {@code canEqual(Object other)} will never be delegated.
|
||||
*
|
||||
* @return For each method (not already in {@code java.lang.Object}) in these types, skip generating a delegate method (overrides {@code types()}).
|
||||
*/
|
||||
Class<?>[] excludes() default {};
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2019 The Project Lombok Authors.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* 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.experimental;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
|
||||
/**
|
||||
* Put on any field to make lombok build a 'wither' - a withX method which produces a clone of this object (except for 1 field which gets a new value).
|
||||
* <p>
|
||||
* Complete documentation is found at <a href="https://projectlombok.org/features/experimental/Wither">the project lombok features page for @Wither</a>.
|
||||
* <p>
|
||||
* Even though it is not listed, this annotation also has the {@code onParam} and {@code onMethod} parameter. See the full documentation for more details.
|
||||
* <p>
|
||||
* Example:
|
||||
* <pre>
|
||||
* private @Wither final int foo;
|
||||
* </pre>
|
||||
*
|
||||
* will generate:
|
||||
*
|
||||
* <pre>
|
||||
* public SELF_TYPE withFoo(int foo) {
|
||||
* return this.foo == foo ? this : new SELF_TYPE(otherField1, otherField2, foo);
|
||||
* }
|
||||
* </pre>
|
||||
* <p>
|
||||
* This annotation can also be applied to a class, in which case it'll be as if all non-static fields that don't already have
|
||||
* a {@code Wither} annotation have the annotation.
|
||||
*
|
||||
* @deprecated {@link lombok.With} has been promoted to the main package, so use that one instead.
|
||||
*/
|
||||
@Target({ElementType.FIELD, ElementType.TYPE})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface Wither {
|
||||
/**
|
||||
* If you want your wither to be non-public, you can specify an alternate access level here.
|
||||
*
|
||||
* @return The method will be generated with this access modifier.
|
||||
*/
|
||||
AccessLevel value() default AccessLevel.PUBLIC;
|
||||
|
||||
/**
|
||||
* Any annotations listed here are put on the generated method.
|
||||
* The syntax for this feature depends on JDK version (nothing we can do about that; it's to work around javac bugs).<br>
|
||||
* up to JDK7:<br>
|
||||
* {@code @Wither(onMethod=@__({@AnnotationsGoHere}))}<br>
|
||||
* from JDK8:<br>
|
||||
* {@code @Wither(onMethod_={@AnnotationsGohere})} // note the underscore after {@code onMethod}.
|
||||
*
|
||||
* @return List of annotations to apply to the generated method.
|
||||
*/
|
||||
AnyAnnotation[] onMethod() default {};
|
||||
|
||||
/**
|
||||
* Any annotations listed here are put on the generated method's parameter.
|
||||
* The syntax for this feature depends on JDK version (nothing we can do about that; it's to work around javac bugs).<br>
|
||||
* up to JDK7:<br>
|
||||
* {@code @Wither(onParam=@__({@AnnotationsGoHere}))}<br>
|
||||
* from JDK8:<br>
|
||||
* {@code @Wither(onParam_={@AnnotationsGohere})} // note the underscore after {@code onParam}.
|
||||
*
|
||||
* @return List of annotations to apply to the generated parameter in the method.
|
||||
*/
|
||||
AnyAnnotation[] onParam() default {};
|
||||
|
||||
/**
|
||||
* Placeholder annotation to enable the placement of annotations on the generated code.
|
||||
* @deprecated Don't use this annotation, ever - Read the documentation.
|
||||
*/
|
||||
@Deprecated
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@Target({})
|
||||
@interface AnyAnnotation {}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2021 The Project Lombok Authors.
|
||||
* Copyright (C) 2010-2026 The Project Lombok Authors.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -25,7 +25,6 @@ import static com.sun.tools.javac.code.Flags.*;
|
||||
import static lombok.core.handlers.HandlerUtil.handleExperimentalFlagUsage;
|
||||
import static lombok.javac.handlers.JavacHandlerUtil.*;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -109,8 +108,7 @@ public class HandleDelegate extends JavacAnnotationHandler<Delegate> {
|
||||
@Override public void handle(AnnotationValues<Delegate> annotation, JCAnnotation ast, JavacNode annotationNode) {
|
||||
handleExperimentalFlagUsage(annotationNode, ConfigurationKeys.DELEGATE_FLAG_USAGE, "@Delegate");
|
||||
|
||||
@SuppressWarnings("deprecation") Class<? extends Annotation> oldDelegate = lombok.Delegate.class;
|
||||
deleteAnnotationIfNeccessary(annotationNode, Delegate.class, oldDelegate);
|
||||
deleteAnnotationIfNeccessary(annotationNode, Delegate.class, "lombok.Delegate");
|
||||
|
||||
Type delegateType;
|
||||
Name delegateName = annotationNode.toName(annotationNode.up().getName());
|
||||
|
||||
@@ -43,7 +43,7 @@ import java.util.List;
|
||||
}
|
||||
}
|
||||
private final int basic;
|
||||
private @lombok.Getter @lombok.Setter @lombok.experimental.Wither int getsetwith;
|
||||
private @lombok.Getter @lombok.Setter @lombok.With int getsetwith;
|
||||
private final int predef;
|
||||
private final int predefWithJavadoc;
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import lombok.Delegate;
|
||||
import lombok.experimental.Delegate;
|
||||
import lombok.Getter;
|
||||
class DelegateOnGetter {
|
||||
private interface Bar {
|
||||
|
||||
@@ -42,7 +42,7 @@ public abstract @lombok.SuperBuilder class SuperBuilderJavadoc {
|
||||
}
|
||||
}
|
||||
private final int basic;
|
||||
private @lombok.Getter @lombok.Setter @lombok.experimental.Wither int getsetwith;
|
||||
private @lombok.Getter @lombok.Setter @lombok.With int getsetwith;
|
||||
private final int predef;
|
||||
private final int predefWithJavadoc;
|
||||
protected @java.lang.SuppressWarnings("all") @lombok.Generated SuperBuilderJavadoc(final SuperBuilderJavadoc.SuperBuilderJavadocBuilder<?, ?> b) {
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.util.regex.Pattern;
|
||||
return this.pattern;
|
||||
}
|
||||
}
|
||||
@lombok.Getter @lombok.experimental.Wither @lombok.AllArgsConstructor class Tolerate2 {
|
||||
@lombok.Getter @lombok.With @lombok.AllArgsConstructor class Tolerate2 {
|
||||
private final Pattern pattern;
|
||||
public @lombok.experimental.Tolerate Tolerate2 withPattern(String pattern) {
|
||||
return withPattern(Pattern.compile(pattern));
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import lombok.AccessLevel;
|
||||
class WitherAccessLevel {
|
||||
@lombok.experimental.Wither(lombok.AccessLevel.NONE) boolean isNone;
|
||||
@lombok.experimental.Wither(AccessLevel.PRIVATE) boolean isPrivate;
|
||||
@lombok.experimental.Wither(lombok.AccessLevel.PACKAGE) boolean isPackage;
|
||||
@lombok.experimental.Wither(AccessLevel.PROTECTED) boolean isProtected;
|
||||
@lombok.experimental.Wither(lombok.AccessLevel.PUBLIC) boolean isPublic;
|
||||
@lombok.experimental.Wither(value = lombok.AccessLevel.PUBLIC) boolean value;
|
||||
@lombok.With(lombok.AccessLevel.NONE) boolean isNone;
|
||||
@lombok.With(AccessLevel.PRIVATE) boolean isPrivate;
|
||||
@lombok.With(lombok.AccessLevel.PACKAGE) boolean isPackage;
|
||||
@lombok.With(AccessLevel.PROTECTED) boolean isProtected;
|
||||
@lombok.With(lombok.AccessLevel.PUBLIC) boolean isPublic;
|
||||
@lombok.With(value = lombok.AccessLevel.PUBLIC) boolean value;
|
||||
WitherAccessLevel(boolean isNone, boolean isPrivate, boolean isPackage, boolean isProtected, boolean isPublic, boolean value) {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ class BuilderJavadoc<T> {
|
||||
*/
|
||||
@lombok.Getter
|
||||
@lombok.Setter
|
||||
@lombok.experimental.Wither
|
||||
@lombok.With
|
||||
private int getsetwith;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//platform !eclipse: Requires a 'full' eclipse with intialized workspace, and we don't (yet) have that set up properly in the test run.
|
||||
import lombok.Delegate;
|
||||
import lombok.experimental.Delegate;
|
||||
import lombok.Getter;
|
||||
|
||||
class DelegateOnGetter {
|
||||
|
||||
@@ -17,7 +17,7 @@ public abstract class SuperBuilderJavadoc {
|
||||
*/
|
||||
@lombok.Getter
|
||||
@lombok.Setter
|
||||
@lombok.experimental.Wither
|
||||
@lombok.With
|
||||
private int getsetwith;
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,7 +9,7 @@ class Tolerate {
|
||||
}
|
||||
}
|
||||
|
||||
@lombok.Getter @lombok.experimental.Wither @lombok.AllArgsConstructor
|
||||
@lombok.Getter @lombok.With @lombok.AllArgsConstructor
|
||||
class Tolerate2 {
|
||||
private final Pattern pattern;
|
||||
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
import lombok.AccessLevel;
|
||||
|
||||
class WitherAccessLevel {
|
||||
@lombok.experimental.Wither(lombok.AccessLevel.NONE)
|
||||
@lombok.With(lombok.AccessLevel.NONE)
|
||||
boolean isNone;
|
||||
|
||||
@lombok.experimental.Wither(AccessLevel.PRIVATE)
|
||||
@lombok.With(AccessLevel.PRIVATE)
|
||||
boolean isPrivate;
|
||||
|
||||
@lombok.experimental.Wither(lombok.AccessLevel.PACKAGE)
|
||||
@lombok.With(lombok.AccessLevel.PACKAGE)
|
||||
boolean isPackage;
|
||||
|
||||
@lombok.experimental.Wither(AccessLevel.PROTECTED)
|
||||
@lombok.With(AccessLevel.PROTECTED)
|
||||
boolean isProtected;
|
||||
|
||||
@lombok.experimental.Wither(lombok.AccessLevel.PUBLIC)
|
||||
@lombok.With(lombok.AccessLevel.PUBLIC)
|
||||
boolean isPublic;
|
||||
|
||||
@lombok.experimental.Wither(value=lombok.AccessLevel.PUBLIC)
|
||||
@lombok.With(value=lombok.AccessLevel.PUBLIC)
|
||||
boolean value;
|
||||
|
||||
WitherAccessLevel(boolean isNone, boolean isPrivate, boolean isPackage, boolean isProtected, boolean isPublic, boolean value) {
|
||||
|
||||
Reference in new issue
Block a user