aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/SneakyThrows.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/lombok/SneakyThrows.java')
-rw-r--r--src/core/lombok/SneakyThrows.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/core/lombok/SneakyThrows.java b/src/core/lombok/SneakyThrows.java
index 4bd79065..a4b30d34 100644
--- a/src/core/lombok/SneakyThrows.java
+++ b/src/core/lombok/SneakyThrows.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009-2012 The Project Lombok Authors.
+ * Copyright (C) 2009-2013 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
@@ -26,6 +26,9 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import lombok.core.FlagUsageType;
+import lombok.core.configuration.ConfigurationKey;
+
/**
* @SneakyThrow will avoid javac's insistence that you either catch or throw onward any checked exceptions that
* statements in your method body declare they generate.
@@ -59,6 +62,13 @@ import java.lang.annotation.Target;
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
@Retention(RetentionPolicy.SOURCE)
public @interface SneakyThrows {
+ /**
+ * lombok configuration: {@code lombok.SneakyThrows.flagUsage} = {@code WARNING} | {@code ERROR}.
+ *
+ * If set, <em>any</em> usage of {@code @SneakyThrows} results in a warning / error.
+ */
+ ConfigurationKey<FlagUsageType> FLAG_USAGE = new ConfigurationKey<FlagUsageType>("lombok.SneakyThrows.flagUsage") {};
+
/** The exception type(s) you want to sneakily throw onward. */
Class<? extends Throwable>[] value() default java.lang.Throwable.class;