mirror of
https://github.com/tiennm99/lombok.git
synced 2026-05-25 17:57:25 +00:00
20 lines
376 B
Plaintext
20 lines
376 B
Plaintext
import lombok.Lombok;
|
|
|
|
public class SneakyThrowsExample implements Runnable {
|
|
public String utf8ToString(byte[] bytes) {
|
|
try {
|
|
return new String(bytes, "UTF-8");
|
|
} catch (UnsupportedEncodingException e) {
|
|
throw Lombok.sneakyThrow(e);
|
|
}
|
|
}
|
|
|
|
public void run() {
|
|
try {
|
|
throw new Throwable();
|
|
} catch (Throwable t) {
|
|
throw Lombok.sneakyThrow(t);
|
|
}
|
|
}
|
|
}
|