Skip to content

Instantly share code, notes, and snippets.

@md-5
Created July 18, 2012 10:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save md-5/3135435 to your computer and use it in GitHub Desktop.
Save md-5/3135435 to your computer and use it in GitHub Desktop.
Lombok, winning!
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import lombok.Cleanup;
import lombok.SneakyThrows;
import lombok.val;
public class Test {
@SneakyThrows(value = IOException.class)
public String lol() {
@Cleanup
val v = new BufferedReader(new InputStreamReader(new ByteArrayInputStream("lol".getBytes())));
return v.readLine();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment