mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-14 12:16:49 +00:00
Merge branch 'npe-warning' of https://github.com/2is10/lombok into 2is10-npe-warning
This commit is contained in:
commit
371b9712df
1 file changed
+2
-3
@@ -48,12 +48,11 @@ public class Lombok {
|
||||
*/
|
||||
public static RuntimeException sneakyThrow(Throwable t) {
|
||||
if (t == null) throw new NullPointerException("t");
|
||||
Lombok.<RuntimeException>sneakyThrow0(t);
|
||||
return null;
|
||||
return Lombok.<RuntimeException>sneakyThrow0(t);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private static <T extends Throwable> void sneakyThrow0(Throwable t) throws T {
|
||||
private static <T extends Throwable> RuntimeException sneakyThrow0(Throwable t) throws T {
|
||||
throw (T)t;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user