aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorttzn <ttzn.dev@gmail.com>2021-03-24 23:52:08 +0100
committerttzn <ttzn.dev@gmail.com>2021-03-24 23:52:08 +0100
commitaf16ba23cd46fa3d3b096daa8d725df2b4d78976 (patch)
tree70639ee886b36a8cc1840ecb34c7d839548b46ee /src
parent63ea3db6b7ab41ff945cad1ec8af7f78b5679f66 (diff)
downloadlombok-af16ba23cd46fa3d3b096daa8d725df2b4d78976.tar.gz
lombok-af16ba23cd46fa3d3b096daa8d725df2b4d78976.tar.bz2
lombok-af16ba23cd46fa3d3b096daa8d725df2b4d78976.zip
@StandardException feature working draft
* move feature under experimental * replace ProviderFor with Provides * add doc material (to be completed) * add author
Diffstat (limited to 'src')
-rwxr-xr-xsrc/core/lombok/eclipse/handlers/HandleStandardException.java8
-rw-r--r--src/core/lombok/experimental/StandardException.java (renamed from src/core/lombok/StandardException.java)2
-rw-r--r--src/core/lombok/javac/handlers/HandleStandardException.java9
3 files changed, 8 insertions, 11 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleStandardException.java b/src/core/lombok/eclipse/handlers/HandleStandardException.java
index 9996f4fa..e7f25edb 100755
--- a/src/core/lombok/eclipse/handlers/HandleStandardException.java
+++ b/src/core/lombok/eclipse/handlers/HandleStandardException.java
@@ -23,16 +23,16 @@ package lombok.eclipse.handlers;
import lombok.AccessLevel;
import lombok.ConfigurationKeys;
-import lombok.StandardException;
+import lombok.experimental.StandardException;
import lombok.core.AST.Kind;
import lombok.core.AnnotationValues;
import lombok.eclipse.Eclipse;
import lombok.eclipse.EclipseAnnotationHandler;
import lombok.eclipse.EclipseNode;
import lombok.eclipse.handlers.EclipseHandlerUtil.*;
+import lombok.spi.Provides;
import org.eclipse.jdt.internal.compiler.ast.*;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
-import org.mangosdk.spi.ProviderFor;
import java.lang.reflect.Modifier;
import java.util.*;
@@ -42,7 +42,7 @@ import static lombok.eclipse.Eclipse.ECLIPSE_DO_NOT_TOUCH_FLAG;
import static lombok.eclipse.Eclipse.pos;
import static lombok.eclipse.handlers.EclipseHandlerUtil.*;
-@ProviderFor(EclipseAnnotationHandler.class)
+@Provides
public class HandleStandardException extends EclipseAnnotationHandler<StandardException> {
private static final String NAME = StandardException.class.getSimpleName();
@@ -175,12 +175,10 @@ public class HandleStandardException extends EclipseAnnotationHandler<StandardEx
@SuppressWarnings("deprecation") public static ConstructorDeclaration createConstructor(
AccessLevel level, EclipseNode type, Collection<SuperParameter> parameters, EclipseNode sourceNode) {
-
ASTNode source = sourceNode.get();
TypeDeclaration typeDeclaration = ((TypeDeclaration) type.get());
boolean isEnum = (((TypeDeclaration) type.get()).modifiers & ClassFileConstants.AccEnum) != 0;
-
if (isEnum) level = AccessLevel.PRIVATE;
boolean addConstructorProperties;
diff --git a/src/core/lombok/StandardException.java b/src/core/lombok/experimental/StandardException.java
index 0456a649..9f8a4e65 100644
--- a/src/core/lombok/StandardException.java
+++ b/src/core/lombok/experimental/StandardException.java
@@ -19,7 +19,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-package lombok;
+package lombok.experimental;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
diff --git a/src/core/lombok/javac/handlers/HandleStandardException.java b/src/core/lombok/javac/handlers/HandleStandardException.java
index 6a382788..598f1aa7 100644
--- a/src/core/lombok/javac/handlers/HandleStandardException.java
+++ b/src/core/lombok/javac/handlers/HandleStandardException.java
@@ -30,7 +30,7 @@ import com.sun.tools.javac.util.ListBuffer;
import com.sun.tools.javac.util.Name;
import lombok.AccessLevel;
import lombok.ConfigurationKeys;
-import lombok.StandardException;
+import lombok.experimental.StandardException;
import lombok.core.AST.Kind;
import lombok.core.AnnotationValues;
import lombok.delombok.LombokOptionsFactory;
@@ -39,13 +39,13 @@ import lombok.javac.JavacAnnotationHandler;
import lombok.javac.JavacNode;
import lombok.javac.JavacTreeMaker;
import lombok.javac.handlers.JavacHandlerUtil.*;
-import org.mangosdk.spi.ProviderFor;
+import lombok.spi.Provides;
import static lombok.core.handlers.HandlerUtil.handleFlagUsage;
import static lombok.javac.Javac.CTC_VOID;
import static lombok.javac.handlers.JavacHandlerUtil.*;
-@ProviderFor(JavacAnnotationHandler.class)
+@Provides
public class HandleStandardException extends JavacAnnotationHandler<StandardException> {
private static final String NAME = StandardException.class.getSimpleName();
@@ -161,7 +161,6 @@ public class HandleStandardException extends JavacAnnotationHandler<StandardExce
if (isEnum) level = AccessLevel.PRIVATE;
boolean addConstructorProperties;
-
if (fieldsToParam.isEmpty()) {
addConstructorProperties = false;
} else {
@@ -194,7 +193,7 @@ public class HandleStandardException extends JavacAnnotationHandler<StandardExce
}
return recursiveSetGeneratedBy(maker.MethodDef(mods, typeNode.toName("<init>"),
null, List.<JCTypeParameter>nil(), params.toList(), List.<JCExpression>nil(),
- maker.Block(0L, statements.toList()), null), source.get(), typeNode.getContext());
+ maker.Block(0L, statements.toList()), null), source);
}
public static boolean isLocalType(JavacNode type) {