Skip to content

Instantly share code, notes, and snippets.

@occho
occho / tags.sh
Created September 11, 2015 13:57
#!/bin/bash
set -o errexit
set -o nounset
#set -o xtrace
readonly SRC_DIR=src
readonly DEP_SRC_DIR=_dep
main() {
mvn dependency:unpack-dependencies -D"outputDirectory=$DEP_SRC_DIR" -D'classifier=sources'
@occho
occho / JavaTest output
Last active August 29, 2015 14:23
Variable arity method tests
1 []
1 null
1 [null, null]
1 [2]
1 [2, 3]
1 [null]
1 [null, null]
@occho
occho / Hello.java
Created June 24, 2015 06:38
NULL_DEREFERENCE and RESOURCE_LEAK
import java.io.IOException;
import java.io.FileOutputStream;
class Hello {
int testInfer_NPE() {
String s = null;
return s.length();
}
void testInfer_notClose() throws IOException {
FileOutputStream s = new FileOutputStream("output.txt");